Skip to content

Commit f31157a

Browse files
committed
Tests: Fixed missing cred test to be complete
1 parent 8bcbc70 commit f31157a

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

tests/src/coveo.spec.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,7 @@ test.describe('Coveo test', () => {
2222
await page.goto('/');
2323
await page.waitForLoadState('load');
2424
await waitFor(async () => await handleConsentPopup(page));
25-
26-
const excludedTests = ['missing coveo credentials'];
27-
if (!excludedTests.includes(test.info().title)) {
28-
await mockCoveoCredentials(page, request);
29-
}
25+
await mockCoveoCredentials(page, request);
3026
});
3127

3228
test.afterEach(async ({ page }) => {
@@ -66,13 +62,15 @@ test.describe('Coveo test', () => {
6662

6763
test('missing coveo credentials', async ({ page }) => {
6864
const searchEndpoint = 'search.html';
69-
await page.goto(`/${searchEndpoint}`);
65+
await page.unroute(`**/${COVEO_CREDENTIALS_ENDPOINT}`);
66+
await page.evaluate(() => window.localStorage.clear());
7067
await page.route(`**/${COVEO_CREDENTIALS_ENDPOINT}`, async (route) => {
7168
await route.fulfill({
7269
status: 404,
7370
contentType: 'text/html; charset=utf-8',
7471
});
7572
});
73+
await page.goto(`/${searchEndpoint}`);
7674

7775
const coveoErrorContent = page.getByTestId('coveo-error-content');
7876
await expect(coveoErrorContent).toBeVisible();

0 commit comments

Comments
 (0)