-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(e2e): add queue lock when active game test (#3)
- Loading branch information
1 parent
1d43c85
commit f108179
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { users } from '../data' | ||
import { expect, launchGame } from '../fixtures/launch-game' | ||
import { GamePage } from '../pages/game.page' | ||
import { QueuePage } from '../pages/queue.page' | ||
|
||
launchGame( | ||
'queue is locked for players that are involved in active game', | ||
async ({ steamIds, gameNumber, pages }) => { | ||
const queueUsers = steamIds.slice(0, 12) | ||
|
||
await Promise.all( | ||
queueUsers.map(async steamId => { | ||
const queuePage = new QueuePage(pages.get(steamId)!) | ||
await queuePage.goto() | ||
for (let i = 0; i < 12; ++i) { | ||
await expect(queuePage.slot(i).joinButton()).toBeDisabled() | ||
} | ||
}), | ||
) | ||
|
||
const adminsPage = new GamePage(pages.get(users[0].steamId)!, gameNumber) | ||
await adminsPage.goto() | ||
await adminsPage.forceEnd() | ||
}, | ||
) |