Skip to content

Commit

Permalink
fix broken coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
codyzu committed Feb 15, 2024
1 parent 5ae64c4 commit 672ae79
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 8 deletions.
2 changes: 2 additions & 0 deletions src/pages/error.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import {test, expect} from '../test/coverage-fixture';

test('displays an error when the presentation does not exist', async ({
page,
// @ts-expect-error activate coverage
coverage,
}) => {
const errorLogs: string[] = [];
page.on('console', (message) => {
Expand Down
8 changes: 7 additions & 1 deletion src/pages/help.e2e.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import {test, expect} from '../test/coverage-fixture';

test('can navigate to the help page from the nav bar', async ({page}) => {
test('can navigate to the help page from the nav bar', async ({
page,
// @ts-expect-error activate coverage
coverage,
}) => {
await page.goto('/');

const presentationList = page.getByRole('list', {
Expand All @@ -18,6 +22,8 @@ test('can navigate to the help page from the nav bar', async ({page}) => {

test('can navigate to the help page the getting started button', async ({
page,
// @ts-expect-error activate coverage
coverage,
}) => {
await page.goto('/');

Expand Down
6 changes: 5 additions & 1 deletion src/pages/home.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ test.beforeAll(async () => {
} as PresentationUpdate);
});

test('lists all presentations', async ({page}) => {
test('lists all presentations', async ({
page,
// @ts-expect-error activate coverage
coverage,
}) => {
await page.goto('/');

const presentationList = page.getByRole('list', {
Expand Down
3 changes: 0 additions & 3 deletions src/pages/upload.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,15 @@ test('can upload and view presentation', async ({page, loginPage}) => {
await presentation.getByRole('button', {name: 'view'}).click();
const page1 = page.getByAltText(/slide page 1/i);
await expect(page1).toBeVisible();
// TODO: instead match just the slide image
await expect(page1).toHaveScreenshot('page-1.png');

await page.getByRole('button', {name: /next/i}).click();
const page2 = page.getByAltText(/slide page 2/i);
await expect(page2).toBeVisible();
// TODO: instead match just the slide image
await expect(page2).toHaveScreenshot('page-2.png');

await page.getByRole('button', {name: /next/i}).click();
const page3 = page.getByAltText(/slide page 3/i);
await expect(page3).toBeVisible();
// TODO: instead match just the slide image
await expect(page3).toHaveScreenshot('page-3.png');
});
14 changes: 11 additions & 3 deletions src/pages/viewer.e2e.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {databaseAdmin} from '../test/firestore';
import {test, expect} from '../test/login-fixture';
import {test, expect} from '../test/coverage-fixture';

let presentationId: string;

Expand All @@ -13,7 +13,11 @@ test.beforeAll(async () => {
presentationId = presentationSnapshot.id;
});

test('navigate the presentation', async ({page}) => {
test('navigate the presentation', async ({
page,
// @ts-expect-error activate coverage
coverage,
}) => {
await page.goto(`/v/${presentationId}`);

const slide1 = page.getByRole('img', {name: 'Slide page 1'});
Expand All @@ -40,7 +44,11 @@ test('navigate the presentation', async ({page}) => {
await expect(slide1).toHaveScreenshot('slide-1.png');
});

test('can share with share buttons', async ({page}) => {
test('can share with share buttons', async ({
page,
// @ts-expect-error activate coverage
coverage,
}) => {
await page.goto(`/v/${presentationId}?slide=2`);

// Twitter
Expand Down

0 comments on commit 672ae79

Please sign in to comment.