2021-02-14 14:25:09 +01:00
|
|
|
import { GameRoom } from './game';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
describe("Room", function () {
|
|
|
|
|
let room: GameRoom = null;
|
|
|
|
|
|
|
|
|
|
describe("onMessage / dispatchMessage", () => {
|
2021-02-14 15:02:50 +01:00
|
|
|
it("should be able to create a GameRoom instance", () => {
|
2021-02-14 14:25:09 +01:00
|
|
|
room = new GameRoom();
|
|
|
|
|
expect(room).not.toBeNull();
|
2021-02-14 15:02:50 +01:00
|
|
|
expect(room).toHaveProperty('dispatcher');
|
|
|
|
|
expect(room).toHaveProperty('currentDealer');
|
|
|
|
|
expect(room).toHaveProperty('gameType');
|
2021-02-14 14:25:09 +01:00
|
|
|
});
|
2021-02-14 15:02:50 +01:00
|
|
|
|
|
|
|
|
it("after creation getSeatedPlayers should return an empty array", () => {
|
|
|
|
|
room = new GameRoom();
|
|
|
|
|
expect(room.getSeatedPlayers()).toEqual([]);
|
|
|
|
|
})
|
2021-02-14 14:25:09 +01:00
|
|
|
});
|
|
|
|
|
});
|