Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
yenienserrano committed Feb 9, 2024
1 parent 546dd0a commit 6b0629a
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 15 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/core/public/chrome/ui/header/header_logo.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ describe('Header logo', () => {
component.find('.logoContainer img').simulate('click');

expect(props.navigateToApp).toHaveBeenCalledTimes(1);
expect(props.navigateToApp).toHaveBeenCalledWith('home');
expect(props.navigateToApp).toHaveBeenCalledWith('wz-home');
});

// ToDo: Add tests for onClick
Expand Down
4 changes: 2 additions & 2 deletions test/functional/apps/home/_home.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await globalNav.clickLogo();
await PageObjects.header.waitUntilLoadingHasFinished();
const url = await browser.getCurrentUrl();
expect(url.includes('/app/home')).to.be(true);
expect(url.includes('/app/wz-home')).to.be(true);
});

it('clicking on home button should take you to home page', async () => {
await PageObjects.common.navigateToApp('settings');
await globalNav.clickHomeButton();
await PageObjects.header.waitUntilLoadingHasFinished();
const url = await browser.getCurrentUrl();
expect(url.includes('/app/home')).to.be(true);
expect(url.includes('/app/wz-home')).to.be(true);
});

it('clicking on console on homepage should take you to console app', async () => {
Expand Down
8 changes: 4 additions & 4 deletions test/functional/apps/visualize/_custom_branding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,15 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await globalNav.clickLogo();
await PageObjects.header.waitUntilLoadingHasFinished();
const url = await browser.getCurrentUrl();
expect(url.includes('/app/home')).to.be(true);
expect(url.includes('/app/wz-home')).to.be(true);
});

it('with customized mark logo button that navigates to home page', async () => {
await PageObjects.common.navigateToApp('settings');
await globalNav.clickHomeButton();
await PageObjects.header.waitUntilLoadingHasFinished();
const url = await browser.getCurrentUrl();
expect(url.includes('/app/home')).to.be(true);
expect(url.includes('/app/wz-home')).to.be(true);
});

// Wazuh: This test is omitted because OpenSearch Dashboards does not have a home dashboard card.
Expand Down Expand Up @@ -211,15 +211,15 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await globalNav.clickLogo();
await PageObjects.header.waitUntilLoadingHasFinished();
const url = await browser.getCurrentUrl();
expect(url.includes('/app/home')).to.be(true);
expect(url.includes('/app/wz-home')).to.be(true);
});

it('with customized mark logo button that navigates to home page', async () => {
await PageObjects.common.navigateToApp('settings');
await globalNav.clickHomeButton();
await PageObjects.header.waitUntilLoadingHasFinished();
const url = await browser.getCurrentUrl();
expect(url.includes('/app/home')).to.be(true);
expect(url.includes('/app/wz-home')).to.be(true);
});

// Wazuh: This test is omitted because OpenSearch Dashboards does not have a home dashboard card.
Expand Down
6 changes: 4 additions & 2 deletions test/functional/page_objects/header_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,10 @@ export function HeaderPageProvider({ getService, getPageObjects }: FtrProviderCo
public async clickStackManagement() {
// Wazuh: Set a local storage item to show the nav group
// because the nav group is hidden by default in our fork
await browser.setLocalStorageItem('core.navGroup.management', 'true');
await appsMenu.clickLink('Dashboards Management', { category: 'management' });
await browser.setLocalStorageItem('core.navGroup.wz-category-dashboard-management', 'true');
await appsMenu.clickLink('Dashboards Management', {
category: 'wz-category-dashboard-management',
});
await this.awaitGlobalLoadingIndicatorHidden();
}

Expand Down

0 comments on commit 6b0629a

Please sign in to comment.