refactor: update test

This commit is contained in:
Carlos Valente
2024-11-18 14:49:40 +01:00
committed by Carlos Valente
parent 9bfa3e9f8e
commit 312b294a61
2 changed files with 24 additions and 18 deletions
@@ -72,7 +72,7 @@ export default function TimelinePage(props: TimelinePageProps) {
}
}
return (
<div className='timeline'>
<div className='timeline' data-testid='timeline-view'>
<ViewParamsEditor viewOptions={progressOptions} />
<div className='project-header'>
{general?.projectLogo && <ViewLogo name={general.projectLogo} className='logo' />}
+23 -17
View File
@@ -4,55 +4,61 @@ test.describe('test view navigation feature', () => {
test('user flow through links', async ({ page }) => {
// default view is timer view
await page.goto('http://localhost:4001/');
await page.locator('data-test-id=timer-view');
page.locator('data-test-id=timer-view');
await page.getByRole('button', { name: 'toggle menu' }).click();
await page.locator('data-test-id=navigation__menu');
page.locator('data-test-id=navigation__menu');
await page.getByRole('link', { name: 'Minimal Timer' }).click();
await page.locator('data-test-id=minimal-timer');
page.locator('data-test-id=minimal-timer');
await expect(page).toHaveURL('http://localhost:4001/minimal');
await page.getByRole('button', { name: 'toggle menu' }).click();
await page.locator('data-test-id=navigation__menu');
page.locator('data-test-id=navigation__menu');
await page.getByRole('link', { name: 'Wall Clock', exact: true }).click();
await page.locator('data-test-id=clock-view');
page.locator('data-test-id=clock-view');
await expect(page).toHaveURL('http://localhost:4001/clock');
await page.getByRole('button', { name: 'toggle menu' }).click();
await page.locator('data-test-id=navigation__menu');
page.locator('data-test-id=navigation__menu');
await page.getByRole('link', { name: 'timeline' }).click();
page.locator('data-test-id=timeline-view');
await expect(page).toHaveURL('http://localhost:4001/timeline');
await page.getByRole('button', { name: 'toggle menu' }).click();
page.locator('data-test-id=navigation__menu');
await page.getByRole('link', { name: 'Backstage' }).click();
await page.locator('data-test-id=backstage-view');
page.locator('data-test-id=backstage-view');
await expect(page).toHaveURL('http://localhost:4001/backstage');
await page.getByRole('button', { name: 'toggle menu' }).click();
await page.locator('data-test-id=navigation__menu');
page.locator('data-test-id=navigation__menu');
await page.getByRole('link', { name: 'Public' }).click();
await page.locator('data-test-id=public-view');
page.locator('data-test-id=public-view');
await expect(page).toHaveURL('http://localhost:4001/public');
await page.getByRole('button', { name: 'toggle menu' }).click();
await page.locator('data-test-id=navigation__menu');
page.locator('data-test-id=navigation__menu');
await page.getByRole('link', { name: 'Lower Thirds' }).click();
await expect(page).toHaveURL('http://localhost:4001/lower');
const errorBoundary = await page.locator('data-test-id=error-container');
const errorBoundary = page.locator('data-test-id=error-container');
await expect(errorBoundary).toHaveCount(0);
await page.getByRole('button', { name: 'toggle menu' }).click();
await page.locator('data-test-id=navigation__menu');
page.locator('data-test-id=navigation__menu');
await page.getByRole('link', { name: 'Studio Clock' }).click();
await page.locator('data-test-id=studio-view');
page.locator('data-test-id=studio-view');
await expect(page).toHaveURL('http://localhost:4001/studio');
await page.getByRole('button', { name: 'toggle menu' }).click();
await page.locator('data-test-id=navigation__menu');
page.locator('data-test-id=navigation__menu');
await page.getByRole('link', { name: 'Countdown' }).click();
await page.locator('data-test-id=countdown-view');
page.locator('data-test-id=countdown-view');
await expect(page).toHaveURL('http://localhost:4001/countdown');
await page.getByRole('button', { name: 'toggle menu' }).click();
await page.locator('data-test-id=navigation__menu');
page.locator('data-test-id=navigation__menu');
await page.getByRole('link', { name: 'Timer', exact: true }).click();
await page.locator('data-test-id=timer-view');
page.locator('data-test-id=timer-view');
await expect(page).toHaveURL('http://localhost:4001/timer');
});
});