Skip to content

Commit

Permalink
chore(tests): Add test for static getBoards
Browse files Browse the repository at this point in the history
  • Loading branch information
AccaliaDeElementia committed Jul 10, 2018
1 parent 7ce1e4e commit 0babf78
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/unit/models/boardTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,17 @@ describe('Board model', () => {
return Board.addBoard({}).should.be.rejectedWith(Error);
});

describe('static getBoards()', () => {
it('should get boards and games', () => {
const expected = [1, 2, 3];
sandbox.stub(utils, 'getBoardsAndGames').resolves(expected);
return Board.getBoards(1701).then((results) => {
results.should.equal(expected);
utils.getBoardsAndGames.calledWith(1701).should.be.true;
});
});
});

it('should find an existing board by ID', () => {
const boardObj = {
Owner: userID,
Expand Down

0 comments on commit 0babf78

Please sign in to comment.