Skip to content

Commit

Permalink
Merge pull request #4768 from relative-ci/fix-report-tests
Browse files Browse the repository at this point in the history
test(cli): Target role tab
  • Loading branch information
vio authored Oct 9, 2024
2 parents 3179af7 + 1ba9b4c commit fe30fb0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions packages/cli/test/e2e/report.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,31 @@ const BASE_PATH = '/bundle-stats.html';
test('should load overview panel', async ({ page }) => {
await page.goto(BASE_PATH);
await expect(page).toHaveTitle(/^Bundle Size — .*\./);
await expect(page.getByRole('link', { name: 'Overview', exact: true })).toHaveAttribute(
await expect(page.getByRole('tab', { name: 'Overview', exact: true })).toHaveAttribute(
'aria-current',
'page',
);
});

test('should load assets panel', async ({ page }) => {
await page.goto(`${BASE_PATH}#/assets`);
await expect(page.getByRole('link', { name: 'Assets', exact: true })).toHaveAttribute(
await expect(page.getByRole('tab', { name: 'Assets', exact: true })).toHaveAttribute(
'aria-current',
'page',
);
});

test('should load modules panel', async ({ page }) => {
await page.goto(`${BASE_PATH}#/modules`);
await expect(page.getByRole('link', { name: 'Modules', exact: true })).toHaveAttribute(
await expect(page.getByRole('tab', { name: 'Modules', exact: true })).toHaveAttribute(
'aria-current',
'page',
);
});

test('should load packages panel', async ({ page }) => {
await page.goto(`${BASE_PATH}#/packages`);
await expect(page.getByRole('link', { name: 'Packages', exact: true })).toHaveAttribute(
await expect(page.getByRole('tab', { name: 'Packages', exact: true })).toHaveAttribute(
'aria-current',
'page',
);
Expand All @@ -38,18 +38,18 @@ test('should load packages panel', async ({ page }) => {
test('should navigate to sections', async ({ page }) => {
await page.goto(BASE_PATH);

const overviewLink = page.getByRole('link', { name: 'Overview', exact: true });
const overviewLink = page.getByRole('tab', { name: 'Overview', exact: true });
await expect(overviewLink).toHaveAttribute('aria-current', 'page');

const assetsLink = page.getByRole('link', { name: 'Assets', exact: true });
const assetsLink = page.getByRole('tab', { name: 'Assets', exact: true });
await assetsLink.click();
await expect(assetsLink).toHaveAttribute('aria-current', 'page');

const modulesLink = page.getByRole('link', { name: 'Modules', exact: true });
const modulesLink = page.getByRole('tab', { name: 'Modules', exact: true });
await modulesLink.click();
await expect(modulesLink).toHaveAttribute('aria-current', 'page');

const packagesLink = page.getByRole('link', { name: 'Packages', exact: true });
const packagesLink = page.getByRole('tab', { name: 'Packages', exact: true });
await packagesLink.click();
await expect(packagesLink).toHaveAttribute('aria-current', 'page');
});
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.group + .group {
:not(.group:empty) ~ .group {
margin-top: calc(var(--space-xxxsmall) / 2);
padding-top: calc(var(--space-xxxsmall) / 2);
border-top: 1px solid var(--color-outline);
Expand Down

0 comments on commit fe30fb0

Please sign in to comment.