Foo
} />
);
expect(lobby.html()).toEqual('Foo
');
});
test('should render custom lobby with games list', () => {
const components: any[] = [
{ game: { name: 'GameName1' } },
{ game: { name: 'GameName2' } },
];
const CustomLobbyUI = ({ gameComponents }: any) => (
{gameComponents
.map((gameComponent) => gameComponent.game.name)
.join(',')}
);
const lobby = Enzyme.mount(
(
)}
/>
);
expect(lobby.html()).toEqual('GameName1,GameName2
');
});
test('should change lobby phase when click on custom enter button', () => {
const CustomLobbyUI = ({ onEnterLobby }: any) => (
);
const lobby: any = Enzyme.mount(
(
)}
/>
);
lobby.find('button').simulate('click');
expect(lobby.instance().state.phase).toEqual('list');
expect(lobby.instance().state.playerName).toEqual('Alex');
});
});
});
});