bgg-ottawa-sell-club/e2e/hide-game.test.js

27 lines
691 B
JavaScript

import { test, expect } from '@playwright/test';
test('hide game', async ({ page }) => {
await page.goto('/');
let nbr_games = 0;
await expect(async () => {
nbr_games = await page
.locator('.game')
.all()
.then((games) => games.length);
expect(nbr_games).toBeGreaterThan(0);
}).toPass();
await page.getByRole('button', { name: 'visibility' }).first().click();
await expect(async () => {
const one_hidden = await page
.locator('.game')
.all()
.then((games) => games.length);
expect(one_hidden).toEqual(nbr_games - 1);
}).toPass({ timeout: 10_000 });
});