Skip to content

Commit

Permalink
Add functional tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sebelga committed Oct 10, 2024
1 parent dfcfd18 commit e80a145
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export const FeedbackBtn: FC = () => {
margin: `0 ${euiTheme.size.m} ${euiTheme.size.m} ${euiTheme.size.m}`,
}}
onDismiss={onDismiss}
data-test-subj="sideNavfeedbackCallout"
>
<EuiText size="s" color="dimgrey">
{i18n.translate('sharedUXPackages.chrome.sideNavigation.feedbackCallout.title', {
Expand Down
11 changes: 11 additions & 0 deletions test/functional/page_objects/solution_navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,17 @@ export function SolutionNavigationProvider(ctx: Pick<FtrProviderContext, 'getSer
await collapseNavBtn.click();
}
},
feedbackCallout: {
async expectExists() {
await testSubjects.existOrFail('sideNavfeedbackCallout', { timeout: TIMEOUT_CHECK });
},
async expectMissing() {
await testSubjects.missingOrFail('sideNavfeedbackCallout', { timeout: TIMEOUT_CHECK });
},
async dismiss() {
await testSubjects.click('sideNavfeedbackCallout > euiDismissCalloutButton');
},
},
},
breadcrumbs: {
async expectExists() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {

await expectNoPageReload();
});

it('renders a feedback callout', async () => {
await solutionNavigation.sidenav.feedbackCallout.expectExists();
await solutionNavigation.sidenav.feedbackCallout.dismiss();
await solutionNavigation.sidenav.feedbackCallout.expectMissing();
await browser.refresh();
await solutionNavigation.sidenav.feedbackCallout.expectMissing();
});
});
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {

await expectNoPageReload();
});

it('renders a feedback callout', async () => {
await solutionNavigation.sidenav.feedbackCallout.expectExists();
await solutionNavigation.sidenav.feedbackCallout.dismiss();
await solutionNavigation.sidenav.feedbackCallout.expectMissing();
await browser.refresh();
await solutionNavigation.sidenav.feedbackCallout.expectMissing();
});
});
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {

await expectNoPageReload();
});

it('renders a feedback callout', async () => {
await solutionNavigation.sidenav.feedbackCallout.expectExists();
await solutionNavigation.sidenav.feedbackCallout.dismiss();
await solutionNavigation.sidenav.feedbackCallout.expectMissing();
await browser.refresh();
await solutionNavigation.sidenav.feedbackCallout.expectMissing();
});
});
});
}

0 comments on commit e80a145

Please sign in to comment.