Compare commits
1 Commits
feat/tests
...
1e13a1d02b
| Author | SHA1 | Date | |
|---|---|---|---|
| 1e13a1d02b |
@@ -30,7 +30,7 @@ test.describe.serial('pizza day životní cyklus', () => {
|
|||||||
const createBtn = page.locator('.pizza-section button', { hasText: 'Založit Pizza day' });
|
const createBtn = page.locator('.pizza-section button', { hasText: 'Založit Pizza day' });
|
||||||
await expect(createBtn).toBeVisible({ timeout: 10_000 });
|
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
|
// Č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'));
|
const createResponse = page.waitForResponse(resp => resp.url().includes('/api/pizzaDay/create'));
|
||||||
await createBtn.click();
|
await createBtn.click();
|
||||||
await createResponse;
|
await createResponse;
|
||||||
await page.reload();
|
await page.reload();
|
||||||
@@ -39,7 +39,7 @@ test.describe.serial('pizza day životní cyklus', () => {
|
|||||||
|
|
||||||
// Přidáme pizzu přes API (obejde komplex SelectSearch)
|
// Přidáme pizzu přes API (obejde komplex SelectSearch)
|
||||||
const token = await page.evaluate(() => localStorage.getItem('token'));
|
const token = await page.evaluate(() => localStorage.getItem('token'));
|
||||||
const addResp = await page.request.post('/api/pizza/add', {
|
const addResp = await page.request.post('/api/pizzaDay/add', {
|
||||||
headers: { 'Authorization': `Bearer ${token}`, 'Content-Type': 'application/json' },
|
headers: { 'Authorization': `Bearer ${token}`, 'Content-Type': 'application/json' },
|
||||||
data: { pizzaIndex: 0, pizzaSizeIndex: 0 },
|
data: { pizzaIndex: 0, pizzaSizeIndex: 0 },
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user