WIP: feat: přidání testů – Jest unit testy + Playwright E2E + CI pipeline #54

Draft
batmanisko wants to merge 20 commits from feat/tests into master
Showing only changes of commit d7c8a4663d - Show all commits
+3 -1
View File
@@ -29,8 +29,10 @@ test.describe.serial('pizza day životní cyklus', () => {
// --- CREATED ---
const createBtn = page.locator('.pizza-section button', { hasText: 'Založit Pizza day' });
await expect(createBtn).toBeVisible({ timeout: 10_000 });
// Čekáme na odpověď API před reloadem jinak by reload přerušil probíhající request
const createResponse = page.waitForResponse(resp => resp.url().includes('/api/pizza/create'));
await createBtn.click();
// Reload zajistí aktuální stav aktualizace přichází přes WebSocket, který networkidle nečeká
await createResponse;
await page.reload();
await page.waitForLoadState('networkidle');
await expect(page.locator('.pizza-section')).toContainText('spravován uživatelem', { timeout: 5_000 });