Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reconfigure UI Shell #14127

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 7 additions & 23 deletions e2e/components/UIShell/UIShell-test.avt.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ const { expect, test } = require('@playwright/test');
const { visitStory } = require('../../test-utils/storybook');

test.describe('UIShell @avt', () => {
test('header base', async ({ page }) => {
test('header', async ({ page }) => {
await visitStory(page, {
component: 'UIShell',
id: 'components-ui-shell--header-base',
id: 'components-ui-shell-header--header-w-navigation',
globals: {
theme: 'white',
},
Expand All @@ -25,36 +25,20 @@ test.describe('UIShell @avt', () => {
test('sidenav rail w/header', async ({ page }) => {
await visitStory(page, {
component: 'UIShell',
id: 'components-ui-shell--side-nav-rail-w-header',
id: 'components-ui-shell-sidenav--side-nav-rail-w-header',
globals: {
theme: 'white',
},
});
await expect(page).toHaveNoACViolations('UIShell-side-nav-rail-w-header');
});

test('sidenav rail w/header - expanded state', async ({ page }) => {
await visitStory(page, {
component: 'UIShell',
id: 'components-ui-shell--side-nav-rail-w-header',
globals: {
theme: 'white',
},
});

// open the menu
page.getByRole('button', { name: 'Open menu' }).click();
await expect(page).toHaveNoACViolations(
'UIShell-side-nav-rail-w-header--expanded'
);
});

test('sidenav rail w/header - expanded state open category sidenav', async ({
page,
}) => {
await visitStory(page, {
component: 'UIShell',
id: 'components-ui-shell--side-nav-rail-w-header',
id: 'components-ui-shell-sidenav--side-nav-rail-w-header',
globals: {
theme: 'white',
},
Expand All @@ -75,7 +59,7 @@ test.describe('UIShell @avt', () => {
}) => {
await visitStory(page, {
component: 'UIShell',
id: 'components-ui-shell--side-nav-rail-w-header',
id: 'components-ui-shell-sidenav--side-nav-rail-w-header',
globals: {
theme: 'white',
},
Expand All @@ -94,7 +78,7 @@ test.describe('UIShell @avt', () => {
test('sidenav rail w/header - keyboard nav', async ({ page }) => {
await visitStory(page, {
component: 'UIShell',
id: 'components-ui-shell--side-nav-rail-w-header',
id: 'components-ui-shell-sidenav--side-nav-rail-w-header',
globals: {
theme: 'white',
},
Expand All @@ -105,7 +89,7 @@ test.describe('UIShell @avt', () => {
page.getByRole('link', { name: 'Skip to main content' })
).toBeFocused();
// tab through the links in the header, landing on the link with sublinks
await page.keyboard.press('Tab');
// await page.keyboard.press('Tab');
await page.keyboard.press('Tab');
await page.keyboard.press('Tab');
await page.keyboard.press('Tab');
Expand Down
36 changes: 18 additions & 18 deletions e2e/components/UIShell/UIShell-test.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,76 +14,76 @@ const { snapshotStory } = require('../../test-utils/storybook');
test.describe('UIShell', () => {
themes.forEach((theme) => {
test.describe(theme, () => {
test('header base @vrt', async ({ page }) => {
test('header @vrt', async ({ page }) => {
await snapshotStory(page, {
component: 'UIShell',
id: 'components-ui-shell--header-base',
id: 'components-ui-shell--header',
theme,
});
});

test('header base w/ navigation @vrt', async ({ page }) => {
test('header w/ navigation @vrt', async ({ page }) => {
await snapshotStory(page, {
component: 'UIShell',
id: 'components-ui-shell--header-base-w-navigation',
id: 'components-ui-shell--header-w-navigation',
theme,
});
});

test('header base w/ actions @vrt', async ({ page }) => {
test('header w/ actions @vrt', async ({ page }) => {
await snapshotStory(page, {
component: 'UIShell',
id: 'components-ui-shell--header-base-w-actions',
id: 'components-ui-shell--header-w-actions',
theme,
});
});

test('header base w/ skiptocontent @vrt', async ({ page }) => {
test('header w/ skiptocontent @vrt', async ({ page }) => {
await snapshotStory(page, {
component: 'UIShell',
id: 'components-ui-shell--header-base-w-skip-to-content',
id: 'components-ui-shell--header-w-skip-to-content',
theme,
});
});

test('header base w/ navigation and actions @vrt', async ({ page }) => {
test('header w/ navigation and actions @vrt', async ({ page }) => {
await snapshotStory(page, {
component: 'UIShell',
id: 'components-ui-shell--header-base-w-navigation-and-actions',
id: 'components-ui-shell--header-w-navigation-and-actions',
theme,
});
});

test('header base w/ navigation, actions and sidenav @vrt', async ({
test('header w/ navigation, actions and sidenav @vrt', async ({
page,
}) => {
await snapshotStory(page, {
component: 'UIShell',
id: 'components-ui-shell--header-base-w-navigation-actions-and-side-nav',
id: 'components-ui-shell--header-w-navigation-actions-and-side-nav',
theme,
});
});

test('header base w/ sidenav @vrt', async ({ page }) => {
test('header w/ sidenav @vrt', async ({ page }) => {
await snapshotStory(page, {
component: 'UIShell',
id: 'components-ui-shell--header-base-w-side-nav',
id: 'components-ui-shell--header-w-side-nav',
theme,
});
});

test('header base w/ actions and right panel @vrt', async ({ page }) => {
test('header w/ actions and right panel @vrt', async ({ page }) => {
await snapshotStory(page, {
component: 'UIShell',
id: 'components-ui-shell--header-base-w-actions-and-right-panel',
id: 'components-ui-shell--header-w-actions-and-right-panel',
theme,
});
});

test('header base w/ actions and switcher @vrt', async ({ page }) => {
test('header w/ actions and switcher @vrt', async ({ page }) => {
await snapshotStory(page, {
component: 'UIShell',
id: 'components-ui-shell--header-base-w-actions-and-switcher',
id: 'components-ui-shell--header-w-actions-and-switcher',
theme,
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3935,6 +3935,9 @@ Map {
"isActive": Object {
"type": "bool",
},
"isCollapsible": Object {
"type": "bool",
},
"onClick": Object {
"type": "func",
},
Expand Down
5 changes: 5 additions & 0 deletions packages/react/src/components/UIShell/HeaderMenuButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ HeaderMenuButton.propTypes = {
*/
isActive: PropTypes.bool,

/**
* Specify whether the menu button is collapsible.
*/
isCollapsible: PropTypes.bool,

/**
* Optionally provide an onClick handler that is called when the underlying
* button fires it's onclick event
Expand Down
Loading
Loading