Skip to content

Commit

Permalink
fix: add playwright tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mbacherycz committed Nov 12, 2024
1 parent 286e077 commit c6133f9
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions packages/frontend/tests/stories/savedSearch.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,25 @@ test.describe('Saved search', () => {
await expect(page.getByRole('button', { name: 'Lagret søk' })).not.toBeVisible();
await expect(page.getByRole('button', { name: 'Lagre søk' })).toBeVisible();
});

test('Saved search link shows correct result', async ({ page }) => {
await page.goto(appURL);

await page.getByRole('button', { name: 'Test Testesen' }).click();
await page.getByText('Testbedrift AS Avd Oslo').click();
await expect(page.getByTestId('pageLayout-background')).toHaveClass(/.*isCompany.*/);
await expect(page.getByRole('link', { name: 'Innkalling til sesjon' })).toBeVisible();

await page.getByPlaceholder('Søk i innboks').click();
await expect(page.getByPlaceholder('Søk i innboks')).toBeVisible();
await page.getByPlaceholder('Søk i innboks').fill('innkalling');
await page.getByPlaceholder('Søk i innboks').press('Enter');
await page.getByRole('button', { name: 'Lagre søk' }).click();
await page.getByRole('link', { name: 'Lagrede søk' }).click();

await expect(page.getByRole('link', { name: 'I Innboks: «innkalling»' })).toBeVisible();
await page.getByRole('link', { name: 'I Innboks: «innkalling»' }).click();
await expect(page.getByRole('link', { name: 'Innkalling til sesjon' })).toBeVisible();
await expect(page.getByTestId('pageLayout-background')).toHaveClass(/.*isCompany.*/);
});
});

0 comments on commit c6133f9

Please sign in to comment.