1
0
resumarkdown/tests/general.test.ts

23 lines
757 B
TypeScript
Raw Normal View History

2024-10-10 21:02:54 -05:00
import { expect, test } from '@playwright/test';
2024-10-11 00:03:49 -05:00
test('page has headline', async ({ page }) => {
2024-10-10 21:02:54 -05:00
await page.goto('/');
2024-10-11 00:03:49 -05:00
const headline = page.locator('header h1');
await expect(headline).toBeVisible();
await expect(headline).toHaveText('resumarkdown');
2024-10-10 21:02:54 -05:00
});
2024-10-11 00:23:32 -05:00
2024-10-11 21:25:58 -05:00
test('nav items work', async ({ page }) => {
await page.goto('/');
let lastPane = '#pane-preview';
for (const pane of ['content', 'style', 'preview']) {
const currentPaneId = `pane-${pane}`;
await page.locator(`nav li[aria-controls="${currentPaneId}"]`).click();
await expect(page.locator(`#${currentPaneId}`)).toBeVisible();
2024-10-12 01:17:44 -05:00
if (lastPane !== '#pane-preview') {
await expect(page.locator(lastPane)).toBeHidden();
}
2024-10-11 21:25:58 -05:00
lastPane = `#${currentPaneId}`;
}
});