Skip to content

Commit

Permalink
Remove checkForUndefinedText checks
Browse files Browse the repository at this point in the history
These were useful in the times when we did not have `safeTranslate`.
Now they are just a hindrance preventing us from using the word
'undefined' in the frontend.
  • Loading branch information
nas-tabchiche committed Dec 4, 2024
1 parent 09d652e commit ca00490
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 13 deletions.
1 change: 0 additions & 1 deletion frontend/tests/functional/detailed/common.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ for (const key of testPages) {
page
}) => {
await pages[key].itemDetail.verifyItem(items[key].build);
await pages[key].checkForUndefinedText();
page.url().includes('evidences') ? await pages[key].page.waitForTimeout(1000) : null; // prevent crashing
});

Expand Down
1 change: 0 additions & 1 deletion frontend/tests/functional/detailed/login.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ test('login / logout process is working properly', async ({
}) => {
await loginPage.hasUrl(1);
await expect.soft(page.getByTestId('login')).toBeVisible();
await loginPage.checkForUndefinedText();
await loginPage.login();
await analyticsPage.hasUrl();
await sideBar.logout();
Expand Down
9 changes: 4 additions & 5 deletions frontend/tests/functional/nav.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,18 @@ test('sidebar navigation tests', async ({ logedPage, analyticsPage, sideBar, pag
await test.step('user profile panel is working properly', async () => {
await sideBar.moreButton.click();
await expect(sideBar.morePanel).not.toHaveAttribute('inert');
await logedPage.checkForUndefinedText();

await expect(sideBar.profileButton).toBeVisible();
await sideBar.profileButton.click();
await expect(sideBar.morePanel).not.toBeVisible();
await expect(page).toHaveURL('/my-profile');
await expect.soft(logedPage.pageTitle).toHaveText('My profile');
await logedPage.checkForUndefinedText();
});

await test.step('docs button is working properly and redirects to gitbook docs', async () => {
await sideBar.moreButton.click();
await expect(sideBar.morePanel).not.toHaveAttribute('inert');
await logedPage.checkForUndefinedText();

await expect(sideBar.docsButton).toBeVisible();
});

Expand All @@ -79,13 +78,13 @@ test('sidebar navigation tests', async ({ logedPage, analyticsPage, sideBar, pag
await test.step('about panel is working properly', async () => {
await sideBar.moreButton.click();
await expect(sideBar.morePanel).not.toHaveAttribute('inert');
await logedPage.checkForUndefinedText();

await expect(sideBar.aboutButton).toBeVisible();
await sideBar.aboutButton.click();
await expect(sideBar.morePanel).toHaveAttribute('inert');
await expect(logedPage.modalTitle).toBeVisible();
await expect.soft(logedPage.modalTitle).toHaveText('About CISO Assistant');
await logedPage.checkForUndefinedText();

await expect(logedPage.page.getByTestId('version-key')).toContainText('version', {
ignoreCase: true
});
Expand Down
6 changes: 0 additions & 6 deletions frontend/tests/utils/base-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,6 @@ export abstract class BasePage {
}
}

async checkForUndefinedText() {
await expect
.soft(this.page.getByText('undefined'), 'An undefined text is visible on the page')
.toHaveCount(0);
}

async waitUntilLoaded() {
const loadingFields = this.page.getByTestId('loading-field');
if ((await loadingFields.count()) > 0) {
Expand Down

0 comments on commit ca00490

Please sign in to comment.