Skip to content

Commit

Permalink
task: [Snapshot test - Part 7] Filing - Unavailable APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
meissadia committed Dec 9, 2024
1 parent b882c9b commit 34722c1
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion e2e/pages/filing-app/unavailableApis.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { expect } from '@playwright/test';
import { test } from '../../fixtures/testFixture';
import { blockApi, verifyApiBlockThenUnblock } from '../../utils/blockApi';
import { ResultUploadMessage, uploadFile } from '../../utils/uploadFile';
import { clickContinue, clickContinueNext } from '../../utils/navigation.utils';
import { checkSnapshot } from '../../utils/snapshotTesting';
import { ResultUploadMessage, uploadFile } from '../../utils/uploadFile';

test('Blocking API Calls - Error Boundaries', async ({
page,
Expand Down Expand Up @@ -91,6 +92,7 @@ test('Blocking API Calls - Error Boundaries', async ({
page.locator('#main .m-notification__error'),
'Error Alert is visible',
).toBeVisible();
await checkSnapshot(page);
});

// Unblock API Call
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions e2e/utils/blockApi.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { Page } from '@playwright/test';
import { expect } from '@playwright/test';
import { test } from '../fixtures/testFixture';
import { checkSnapshot } from './snapshotTesting';

export async function blockApi(
page: Page,
Expand Down Expand Up @@ -57,6 +58,7 @@ export const verifyApiBlockThenUnblock = async ({
await expect(page.locator('h1'), 'h1 is correct').toContainText(
'An unknown error occurred',
);
await checkSnapshot(page);
});

// Unblock API Call
Expand Down

0 comments on commit 34722c1

Please sign in to comment.