Skip to content

Commit

Permalink
chore(ui): add test for font preview (#32225)
Browse files Browse the repository at this point in the history
Adds a test for the font preview feature.
  • Loading branch information
Skn0tt authored Aug 22, 2024
1 parent 947fbc8 commit 0b9c036
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/library/trace-viewer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,20 @@ test('should filter network requests by resource type', async ({ page, runAndTra
await expect(traceViewer.networkRequests.getByText('font.woff2')).toBeVisible();
});

test('should show font preview', async ({ page, runAndTrace, server }) => {
const traceViewer = await runAndTrace(async () => {
await page.goto(`${server.PREFIX}/network-tab/network.html`);
});
await traceViewer.selectAction('http://localhost');
await traceViewer.showNetworkTab();

await traceViewer.page.getByText('Font', { exact: true }).click();
await expect(traceViewer.networkRequests).toHaveCount(1);
await traceViewer.networkRequests.getByText('font.woff2').click();
await traceViewer.page.getByTestId('network-request-details').getByTitle('Body').click();
await expect(traceViewer.page.locator('.network-request-details-tab')).toContainText('ABCDEF');
});

test('should filter network requests by url', async ({ page, runAndTrace, server }) => {
const traceViewer = await runAndTrace(async () => {
await page.goto(`${server.PREFIX}/network-tab/network.html`);
Expand Down

0 comments on commit 0b9c036

Please sign in to comment.