Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cee-chen committed Oct 27, 2023
1 parent 72b3043 commit 1f699d5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ exports[`EuiGlobalToastList is rendered 1`] = `
aria-live="polite"
class="euiGlobalToastList testClass1 testClass2 emotion-euiGlobalToastList-right-euiTestCss"
data-test-subj="test subject string"
role="region"
role="log"
/>
`;

exports[`EuiGlobalToastList props side can be changed to left 1`] = `
<div
aria-live="polite"
class="euiGlobalToastList emotion-euiGlobalToastList-left"
role="region"
role="log"
>
<div
class="euiToast euiGlobalToastListItem emotion-euiToast-success-euiGlobalToastListItem"
Expand Down Expand Up @@ -117,7 +117,7 @@ exports[`EuiGlobalToastList props toasts is rendered 1`] = `
<div
aria-live="polite"
class="euiGlobalToastList emotion-euiGlobalToastList-right"
role="region"
role="log"
>
<div
class="euiToast euiGlobalToastListItem emotion-euiToast-success-euiGlobalToastListItem"
Expand Down
13 changes: 13 additions & 0 deletions src/components/toast/global_toast_list.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -271,5 +271,18 @@ describe('EuiGlobalToastList', () => {
expect(sharedProps.dismissToast).toHaveBeenCalledTimes(TOAST_COUNT);
});
});

test('role', () => {
const { queryByRole } = render(
<EuiGlobalToastList
dismissToast={() => {}}
toastLifeTimeMs={5}
role="alert"
/>
);

expect(queryByRole('alert')).toBeInTheDocument();
expect(queryByRole('log')).not.toBeInTheDocument();
});
});
});

0 comments on commit 1f699d5

Please sign in to comment.