From ecbbeb2cecdb0a7541f4554419b69cb05f5f6b56 Mon Sep 17 00:00:00 2001 From: Martin Berka Date: Wed, 29 Apr 2026 20:41:57 +0200 Subject: [PATCH] =?UTF-8?q?test:=20opravy=20Playwright=20test=C5=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- e2e/tests/pizza-day.spec.ts | 2 ++ e2e/tests/qr.spec.ts | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/e2e/tests/pizza-day.spec.ts b/e2e/tests/pizza-day.spec.ts index 1eb087d..869ee56 100644 --- a/e2e/tests/pizza-day.spec.ts +++ b/e2e/tests/pizza-day.spec.ts @@ -30,6 +30,8 @@ test.describe.serial('pizza day životní cyklus', () => { const createBtn = page.locator('.pizza-section button', { hasText: 'Založit Pizza day' }); await expect(createBtn).toBeVisible({ timeout: 10_000 }); await createBtn.click(); + // Reload zajistí aktuální stav – aktualizace přichází přes WebSocket, který networkidle nečeká + await page.reload(); await page.waitForLoadState('networkidle'); await expect(page.locator('.pizza-section')).toContainText('spravován uživatelem', { timeout: 5_000 }); diff --git a/e2e/tests/qr.spec.ts b/e2e/tests/qr.spec.ts index 3440c01..20777c8 100644 --- a/e2e/tests/qr.spec.ts +++ b/e2e/tests/qr.spec.ts @@ -24,9 +24,10 @@ test('Nastavení ukládají číslo účtu a jméno do localStorage', async ({ p await expect(page.locator('.modal-title')).toContainText('Nastavení', { timeout: 5_000 }); // Změníme číslo účtu – pressSequentially zajistí spuštění React onChange na každý znak + // Číslo 1000000005 je platné (kontrolní součet mod 11 = 0), jinak by validace zamítla uložení const accountInput = page.getByPlaceholder('123456-1234567890/1234'); await accountInput.click({ clickCount: 3 }); - await accountInput.pressSequentially('1234567890/5500'); + await accountInput.pressSequentially('1000000005/5500'); // Změníme jméno const nameInput = page.getByPlaceholder('Jan Novák'); @@ -40,7 +41,7 @@ test('Nastavení ukládají číslo účtu a jméno do localStorage', async ({ p // Ověříme v localStorage const bankAccount = await page.evaluate(() => localStorage.getItem('bank_account_number')); const holderName = await page.evaluate(() => localStorage.getItem('bank_account_holder_name')); - expect(bankAccount).toBe('1234567890/5500'); + expect(bankAccount).toBe('1000000005/5500'); expect(holderName).toBe('Nové Jméno'); });