Skip to content

Commit

Permalink
test(e2e): add queue lock when active game test (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
garrappachc authored Aug 13, 2024
1 parent 1d43c85 commit f108179
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/10-queue/06-queue-locked-when-active-game.spec.ts
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()
},
)

0 comments on commit f108179

Please sign in to comment.