Skip to content

Commit

Permalink
Merge branch 'main' into 12545-add-types-to-fileuploader
Browse files Browse the repository at this point in the history
  • Loading branch information
tw15egan committed Jun 26, 2023
2 parents 2fc3759 + 2ee33d7 commit 96da1b8
Show file tree
Hide file tree
Showing 30 changed files with 600 additions and 24 deletions.
144 changes: 144 additions & 0 deletions e2e/components/UIShell/UIShell-test.avt.e2e.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
/**
* Copyright IBM Corp. 2016, 2023
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

'use strict';

const { expect, test } = require('@playwright/test');
const { visitStory } = require('../../test-utils/storybook');

test.describe('UIShell @avt', () => {
test('header base', async ({ page }) => {
await visitStory(page, {
component: 'UIShell',
id: 'components-ui-shell--header-base',
globals: {
theme: 'white',
},
});
await expect(page).toHaveNoACViolations('UIShell');
});

test('sidenav rail w/header', async ({ page }) => {
await visitStory(page, {
component: 'UIShell',
id: 'components-ui-shell--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',
globals: {
theme: 'white',
},
});
// open a category within the menu
page
.getByRole('button', { name: 'Category title' })
.first()
// The overlay causes the actionability checks to fail, so use `force` to bypass the checks
.click({ force: true });
await expect(page).toHaveNoACViolations(
'UIShell-side-nav-rail-w-header--expanded--category-expanded'
);
});

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

// open the header link dropdown
page
.getByRole('link', { name: 'Link 4' })
// The overlay causes the actionability checks to fail, so use `force` to bypass the checks
.click({ force: true });
await expect(page).toHaveNoACViolations(
'UIShell-side-nav-rail-w-header--expanded--header-link'
);
});

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

await page.keyboard.press('Tab');
await expect(
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');
await page.keyboard.press('Tab');
await expect(page.getByRole('link', { name: 'Link 4' })).toBeFocused();
// open the sublinks menu
await page.keyboard.press('Space');
await expect(page.getByRole('link', { name: 'Sub-link 1' })).toBeVisible();
// tab through the sublinks menu
await page.keyboard.press('Tab');
await page.keyboard.press('Tab');
await page.keyboard.press('Tab');
await expect(page.getByRole('link', { name: 'Sub-link 3' })).toBeFocused();
// tab once more and the sublinks menu should close
await page.keyboard.press('Tab');
await expect(
page.getByRole('link', { name: 'Sub-link 1' })
).not.toBeVisible();
// tab through to open the sidenav
await page.keyboard.press('Tab');
await page.keyboard.press('Tab');
await page.keyboard.press('Tab');
await expect(
page.getByRole('button', { name: 'Category title' }).first()
).toBeFocused();
// tab through the rest of the sidenav menu
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');
// focus should then be within the main content of the page
await expect(page.getByRole('link', { name: 'Carbon' })).toBeFocused();
});
});
15 changes: 2 additions & 13 deletions e2e/components/UIShell/UIShell-test.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

'use strict';

const { expect, test } = require('@playwright/test');
const { test } = require('@playwright/test');
const { themes } = require('../../test-utils/env');
const { snapshotStory, visitStory } = require('../../test-utils/storybook');
const { snapshotStory } = require('../../test-utils/storybook');

test.describe('UIShell', () => {
themes.forEach((theme) => {
Expand Down Expand Up @@ -137,15 +137,4 @@ test.describe('UIShell', () => {
});
});
});

test('accessibility-checker @avt', async ({ page }) => {
await visitStory(page, {
component: 'UIShell',
id: 'components-ui-shell--header-base',
globals: {
theme: 'white',
},
});
await expect(page).toHaveNoACViolations('UIShell');
});
});
17 changes: 17 additions & 0 deletions e2e/pictograms-react/__snapshots__/PublicAPI-test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Array [
"AdvancedFraudProtection",
"AdvancedThreats",
"Advocate",
"AdvocateMask",
"Agility",
"AgilityWithHybridMulticloud",
"Agriculture",
Expand Down Expand Up @@ -217,6 +218,8 @@ Array [
"Console",
"ConsoleWireless",
"Construct",
"ConstructionWorker",
"ConstructionWorkerMask",
"ConsumerEngagementFoodJourney",
"Container",
"ContainerMicroservices",
Expand All @@ -238,6 +241,14 @@ Array [
"CreditCard",
"Crop",
"Cupcake",
"CurveCubic",
"CurveExponential",
"CurveInverse",
"CurveLinear",
"CurveLogarithmic",
"CurveLogistic",
"CurvePower",
"CurveQuadratic",
"CustomReports",
"CustomWorkloads",
"CustomerService",
Expand Down Expand Up @@ -680,6 +691,7 @@ Array [
"Puzzle",
"QQPlot",
"QrCode",
"Quantum",
"QuantumComputing",
"QuantumSafe",
"Question",
Expand Down Expand Up @@ -916,6 +928,7 @@ Array [
"UserExperienceDesign",
"UserInsights",
"UserInterface",
"UserMask",
"UserProfile",
"UserSearch",
"Vancouver",
Expand Down Expand Up @@ -944,6 +957,10 @@ Array [
"WashingtonDcCapitol",
"WashingtonDcMonument",
"WatsonLogo",
"Watsonx",
"WatsonxAi",
"WatsonxData",
"WatsonxGovernance",
"Weather",
"WebDeveloper",
"Webcast",
Expand Down
17 changes: 17 additions & 0 deletions e2e/pictograms/__snapshots__/PublicAPI-test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Array [
"AdvancedFraudProtection",
"AdvancedThreats",
"Advocate",
"AdvocateMask",
"Agility",
"AgilityWithHybridMulticloud",
"Agriculture",
Expand Down Expand Up @@ -217,6 +218,8 @@ Array [
"Console",
"ConsoleWireless",
"Construct",
"ConstructionWorker",
"ConstructionWorkerMask",
"ConsumerEngagementFoodJourney",
"Container",
"ContainerMicroservices",
Expand All @@ -238,6 +241,14 @@ Array [
"CreditCard",
"Crop",
"Cupcake",
"CurveCubic",
"CurveExponential",
"CurveInverse",
"CurveLinear",
"CurveLogarithmic",
"CurveLogistic",
"CurvePower",
"CurveQuadratic",
"CustomReports",
"CustomWorkloads",
"CustomerService",
Expand Down Expand Up @@ -679,6 +690,7 @@ Array [
"Puzzle",
"QQPlot",
"QrCode",
"Quantum",
"QuantumComputing",
"QuantumSafe",
"Question",
Expand Down Expand Up @@ -915,6 +927,7 @@ Array [
"UserExperienceDesign",
"UserInsights",
"UserInterface",
"UserMask",
"UserProfile",
"UserSearch",
"Vancouver",
Expand Down Expand Up @@ -943,6 +956,10 @@ Array [
"WashingtonDcCapitol",
"WashingtonDcMonument",
"WatsonLogo",
"Watsonx",
"WatsonxAi",
"WatsonxData",
"WatsonxGovernance",
"Weather",
"WebDeveloper",
"Webcast",
Expand Down
Binary file modified packages/icons/examples/preview/.yarn/install-state.gz
Binary file not shown.
6 changes: 3 additions & 3 deletions packages/icons/examples/preview/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1271,13 +1271,13 @@ fsevents@~2.3.2:
linkType: hard

"semver@npm:^7.3.2":
version: 7.3.4
resolution: "semver@npm:7.3.4"
version: 7.5.3
resolution: "semver@npm:7.5.3"
dependencies:
lru-cache: ^6.0.0
bin:
semver: bin/semver.js
checksum: 96451bfd7cba9b60ee87571959dc47e87c95b2fe58a9312a926340fee9907fc7bc062c352efdaf5bb24b2dff59c145e14faf7eb9d718a84b4751312531b39f43
checksum: 9d58db16525e9f749ad0a696a1f27deabaa51f66e91d2fa2b0db3de3e9644e8677de3b7d7a03f4c15bc81521e0c3916d7369e0572dbde250d9bedf5194e2a8a7
languageName: node
linkType: hard

Expand Down
18 changes: 18 additions & 0 deletions packages/pictograms/categories.yml
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,14 @@ categories:
- chart--t-SNE
- circle--packing
- code--syntax
- curve--cubic
- curve--exponential
- curve--inverse
- curve--linear
- curve--logarithmic
- curve--logistic
- curve--power
- curve--quadratic
- dashboard
- data--apis
- data--set
Expand All @@ -401,6 +409,7 @@ categories:
- math--curve
- population--diagram
- q-q-plot
- quantum
- rank
- relationship--diagram
- report
Expand Down Expand Up @@ -456,6 +465,7 @@ categories:
- name: Design and development
members:
- app--developer
- app--modernization
- application
- art--tools--01
- birthday--cake
Expand Down Expand Up @@ -639,6 +649,8 @@ categories:
- cargo--crane
- cargo--ship
- cheese
- construction-worker--mask
- construction-worker
- farm--01
- farm--02
- farmer--01
Expand Down Expand Up @@ -788,6 +800,7 @@ categories:
- name: People
members:
- advocate
- advocate--mask
- design-thinking-team
- expand--user
- face--dissatisfied
Expand Down Expand Up @@ -815,6 +828,7 @@ categories:
- team--alignment
- teammates
- user
- user--mask
- user--profile
- user--search
- name: Red Hat
Expand Down Expand Up @@ -1019,6 +1033,10 @@ categories:
- visual--insights
- visual--recognition
- watson--logo
- watsonx--ai
- watsonx--data
- watsonx--governance
- watsonx
- name: Weather
members:
- cloudy
Expand Down
Binary file modified packages/pictograms/examples/preview/.yarn/install-state.gz
Binary file not shown.
6 changes: 3 additions & 3 deletions packages/pictograms/examples/preview/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1271,13 +1271,13 @@ fsevents@~2.3.2:
linkType: hard

"semver@npm:^7.3.2":
version: 7.3.4
resolution: "semver@npm:7.3.4"
version: 7.5.3
resolution: "semver@npm:7.5.3"
dependencies:
lru-cache: ^6.0.0
bin:
semver: bin/semver.js
checksum: 96451bfd7cba9b60ee87571959dc47e87c95b2fe58a9312a926340fee9907fc7bc062c352efdaf5bb24b2dff59c145e14faf7eb9d718a84b4751312531b39f43
checksum: 9d58db16525e9f749ad0a696a1f27deabaa51f66e91d2fa2b0db3de3e9644e8677de3b7d7a03f4c15bc81521e0c3916d7369e0572dbde250d9bedf5194e2a8a7
languageName: node
linkType: hard

Expand Down
Loading

0 comments on commit 96da1b8

Please sign in to comment.