Skip to content

Commit

Permalink
chore: U test for checking overridden classes (#2993)
Browse files Browse the repository at this point in the history
  • Loading branch information
georgylobko authored Nov 11, 2024
1 parent 96418ea commit a6379c5
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/app-layout/__tests__/runtime-drawers.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,24 @@ describeEachAppLayout(({ theme, size }) => {

describe('toolbar mode only features', () => {
describeEachAppLayout({ themes: ['refresh-toolbar'], sizes: ['desktop'] }, () => {
test('should contain overridden in AWS-UI-Widget-Global-Navigation css classes for drawers', async () => {
const { wrapper } = await renderComponent(<AppLayout drawers={[testDrawer]} />);

awsuiPlugins.appLayout.registerDrawer({
...drawerDefaults,
id: 'global-drawer',
type: 'global',
mountContent: container => (container.textContent = 'global drawer content 1'),
});

await delay();

wrapper.findDrawerTriggerById('global-drawer')!.click();

expect(wrapper!.find('[class*="awsui_drawer-close-button_12i0j"]')).toBeTruthy();
expect(wrapper!.find('[class*="awsui_drawer-global_12i0j"][class*="awsui_last-opened_12i0j"]')).toBeTruthy();
});

test('registerDrawer registers local drawers if type is not specified', async () => {
awsuiPlugins.appLayout.registerDrawer({
...drawerDefaults,
Expand Down

0 comments on commit a6379c5

Please sign in to comment.