diff --git a/Taskfile.yaml b/Taskfile.yaml index c1d7c5b..2ba33ea 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -6,6 +6,16 @@ vars: GREETING: Hello, World! tasks: + is-clean: git is-clean + integrate: + deps: [is-clean, test] + cmds: + - echo "do something" + test:unit: + cmds: + - vitest run + test: + deps: [test:unit, test:e2e] preview: deps: [build] cmds: diff --git a/e2e/hide-game.test.js b/e2e/hide-game.test.js index 6facf69..fb6d581 100644 --- a/e2e/hide-game.test.js +++ b/e2e/hide-game.test.js @@ -2,16 +2,22 @@ import { test, expect } from '@playwright/test'; test('hide game', async ({ page }) => { await page.goto('/'); - const nbr_games = await page - .locator('.games > div') - .all() - .then((games) => games.length); + + 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('.games > div') + .locator('.game') .all() .then((games) => games.length); diff --git a/src/routes/Game.svelte b/src/routes/Game.svelte new file mode 100644 index 0000000..67eb235 --- /dev/null +++ b/src/routes/Game.svelte @@ -0,0 +1,114 @@ +