Move board.js into components/ as Board.js
This commit is contained in:
parent
c111a16a34
commit
7fd455fe6d
|
@ -2,8 +2,8 @@ import React from 'react';
|
|||
import ReactDOM from 'react-dom';
|
||||
import renderer from 'react-test-renderer';
|
||||
|
||||
import Board from './board';
|
||||
import * as game from './board';
|
||||
import Board from './components/Board';
|
||||
import * as game from './components/Board';
|
||||
|
||||
it('detects friendship and enemyship', () => {
|
||||
const black = new game.Piece(game.BLACK, game.KING);
|
||||
|
@ -84,6 +84,7 @@ it('detects an obvious checkmate', () => {
|
|||
];
|
||||
const board = new Board({text: rows.join('')});
|
||||
const inCheck = board.whoInCheck();
|
||||
expect(board.checkmate()).toBe(true)
|
||||
expect(inCheck.type).toEqual(game.KING);
|
||||
expect(inCheck.color).toEqual(game.BLACK);
|
||||
});
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import React from 'react';
|
||||
import Popup from './components/Popup';
|
||||
import Popup from './Popup';
|
||||
|
||||
import './index.css';
|
||||
import '../index.css';
|
||||
|
||||
|
||||
const BLACK = 0;
|
|
@ -2,7 +2,7 @@ import React from 'react';
|
|||
import ReactDOM from 'react-dom';
|
||||
import io from 'socket.io-client';
|
||||
|
||||
import Board from './board';
|
||||
import Board from './components/Board';
|
||||
|
||||
import './index.css';
|
||||
|
||||
|
|
Loading…
Reference in New Issue