Skip to content

Commit

Permalink
test(containedlist): move to stable - add vrt, avt, storybook docs (#…
Browse files Browse the repository at this point in the history
…12387)

* test(containedlist): add vrt, avt, storybook docs

* docs(containedlist): add platform metdata, livedemo mdx

* test(containedlist): update vrt, stories to show adjacent list padding
  • Loading branch information
tay1orjones committed Nov 3, 2022
1 parent 3e192c0 commit f7ed5db
Show file tree
Hide file tree
Showing 8 changed files with 298 additions and 129 deletions.
101 changes: 101 additions & 0 deletions e2e/components/ContainedList/ContainedList-test.e2e.js
@@ -0,0 +1,101 @@
/**
* Copyright IBM Corp. 2016, 2018
*
* 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 { themes } = require('../../test-utils/env');
const { snapshotStory, visitStory } = require('../../test-utils/storybook');

test.describe('ContainedList', () => {
themes.forEach((theme) => {
test.describe(theme, () => {
test('default @vrt', async ({ page }) => {
await snapshotStory(page, {
component: 'ContainedList',
id: 'components-containedlist--default',
theme,
});
});

test('disclosed @vrt', async ({ page }) => {
await snapshotStory(page, {
component: 'ContainedList',
id: 'components-containedlist--disclosed',
theme,
});
});

test('with-actions @vrt', async ({ page }) => {
await snapshotStory(page, {
component: 'ContainedList',
id: 'components-containedlist--with-actions',
theme,
});
});

test('with-icons @vrt', async ({ page }) => {
await snapshotStory(page, {
component: 'ContainedList',
id: 'components-containedlist--with-icons',
theme,
});
});

test('with-interactive-items @vrt', async ({ page }) => {
await snapshotStory(page, {
component: 'ContainedList',
id: 'components-containedlist--with-interactive-items',
theme,
});
});

test('with-interactive-items-and-actions @vrt', async ({ page }) => {
await snapshotStory(page, {
component: 'ContainedList',
id: 'components-containedlist--with-interactive-items-and-actions',
theme,
});
});

test('with-layer @vrt', async ({ page }) => {
await snapshotStory(page, {
component: 'ContainedList',
id: 'components-containedlist--with-layer',
theme,
});
});

test('with-list-title-decorators @vrt', async ({ page }) => {
await snapshotStory(page, {
component: 'ContainedList',
id: 'components-containedlist--with-list-title-decorators',
theme,
});
});

test('playground @vrt', async ({ page }) => {
await snapshotStory(page, {
component: 'ContainedList',
id: 'components-containedlist--playground',
theme,
});
});
});
});

test('accessibility-checker @avt', async ({ page }) => {
await visitStory(page, {
component: 'ContainedList',
id: 'components-containedlist--default',
globals: {
theme: 'white',
},
});
await expect(page).toHaveNoACViolations('ContainedList');
});
});
200 changes: 100 additions & 100 deletions packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap
Expand Up @@ -1294,6 +1294,106 @@ Map {
},
"render": [Function],
},
"ContainedList" => Object {
"ContainedListItem": Object {
"propTypes": Object {
"action": Object {
"type": "node",
},
"children": Object {
"type": "node",
},
"className": Object {
"type": "string",
},
"disabled": Object {
"type": "bool",
},
"onClick": Object {
"type": "func",
},
"renderIcon": Object {
"args": Array [
Array [
Object {
"type": "func",
},
Object {
"type": "object",
},
],
],
"type": "oneOfType",
},
},
},
"propTypes": Object {
"action": Object {
"type": "node",
},
"children": Object {
"type": "node",
},
"className": Object {
"type": "string",
},
"kind": Object {
"args": Array [
Array [
"on-page",
"disclosed",
],
],
"type": "oneOf",
},
"label": Object {
"args": Array [
Array [
Object {
"type": "string",
},
Object {
"type": "node",
},
],
],
"isRequired": true,
"type": "oneOfType",
},
},
},
"ContainedListItem" => Object {
"propTypes": Object {
"action": Object {
"type": "node",
},
"children": Object {
"type": "node",
},
"className": Object {
"type": "string",
},
"disabled": Object {
"type": "bool",
},
"onClick": Object {
"type": "func",
},
"renderIcon": Object {
"args": Array [
Array [
Object {
"type": "func",
},
Object {
"type": "object",
},
],
],
"type": "oneOfType",
},
},
},
"Content" => Object {
"defaultProps": Object {
"tagName": "main",
Expand Down Expand Up @@ -8705,106 +8805,6 @@ Map {
"$$typeof": Symbol(react.forward_ref),
"render": [Function],
},
"unstable_ContainedList" => Object {
"ContainedListItem": Object {
"propTypes": Object {
"action": Object {
"type": "node",
},
"children": Object {
"type": "node",
},
"className": Object {
"type": "string",
},
"disabled": Object {
"type": "bool",
},
"onClick": Object {
"type": "func",
},
"renderIcon": Object {
"args": Array [
Array [
Object {
"type": "func",
},
Object {
"type": "object",
},
],
],
"type": "oneOfType",
},
},
},
"propTypes": Object {
"action": Object {
"type": "node",
},
"children": Object {
"type": "node",
},
"className": Object {
"type": "string",
},
"kind": Object {
"args": Array [
Array [
"on-page",
"disclosed",
],
],
"type": "oneOf",
},
"label": Object {
"args": Array [
Array [
Object {
"type": "string",
},
Object {
"type": "node",
},
],
],
"isRequired": true,
"type": "oneOfType",
},
},
},
"unstable_ContainedListItem" => Object {
"propTypes": Object {
"action": Object {
"type": "node",
},
"children": Object {
"type": "node",
},
"className": Object {
"type": "string",
},
"disabled": Object {
"type": "bool",
},
"onClick": Object {
"type": "func",
},
"renderIcon": Object {
"args": Array [
Array [
Object {
"type": "func",
},
Object {
"type": "object",
},
],
],
"type": "oneOfType",
},
},
},
"unstable_FeatureFlags" => Object {
"propTypes": Object {
"children": Object {
Expand Down
18 changes: 16 additions & 2 deletions packages/react/carbon.yml
Expand Up @@ -51,7 +51,7 @@ assets:
action: link
url: https://react.carbondesignsystem.com/?path=/docs/components-aspectratio
docs:
overviewPath: './src/components/AspectRatio/docs/overview.mdx'
overviewPath: './src/components/AspectRatio/docs/overview.mdx'
breadcrumb:
status: stable
externalDocsUrl: https://www.carbondesignsystem.com/components/breadcrumb/usage
Expand Down Expand Up @@ -134,6 +134,20 @@ assets:
- input-control
docs:
overviewPath: ./src/components/ComposedModal/docs/overview.mdx
contained-list:
status: stable
externalDocsUrl: https://www.carbondesignsystem.com/components/contained-list/usage
framework: react
demoLinks:
- type: storybook
name: Storybook
action: link
url: https://react.carbondesignsystem.com/?path=/docs/components-containedlist
docs:
usagePath: https://github.com/carbon-design-system/carbon-website/blob/main/src/pages/components/contained-list/usage.mdx
stylePath: https://github.com/carbon-design-system/carbon-website/blob/main/src/pages/components/contained-list/style.mdx
accessibilityPath: https://github.com/carbon-design-system/carbon-website/blob/main/src/pages/components/contained-list/accessibility.mdx
overviewPath: ./src/components/ContainedList/docs/overview.mdx
content-switcher:
status: stable
externalDocsUrl: https://www.carbondesignsystem.com/components/content-switcher/usage
Expand Down Expand Up @@ -818,7 +832,7 @@ assets:
usagePath: https://github.com/carbon-design-system/carbon-website/blob/main/src/pages/components/toggle/usage.mdx
stylePath: https://github.com/carbon-design-system/carbon-website/blob/main/src/pages/components/toggle/style.mdx
accessibilityPath: https://github.com/carbon-design-system/carbon-website/blob/main/src/pages/components/toggle/accessibility.mdx
overviewPath: ./src/components/Toggle/docs/overview.mdx
overviewPath: ./src/components/Toggle/docs/overview.mdx
toggletip:
status: stable
externalDocsUrl: https://www.carbondesignsystem.com/components/toggletip/usage
Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/__tests__/index-test.js
Expand Up @@ -36,6 +36,8 @@ describe('Carbon Components React', () => {
"ColumnHang",
"ComboBox",
"ComposedModal",
"ContainedList",
"ContainedListItem",
"Content",
"ContentSwitcher",
"ControlledPasswordInput",
Expand Down Expand Up @@ -214,8 +216,6 @@ describe('Carbon Components React', () => {
"TreeView",
"UnorderedList",
"VStack",
"unstable_ContainedList",
"unstable_ContainedListItem",
"unstable_FeatureFlags",
"unstable_LayoutDirection",
"unstable_Menu",
Expand Down

0 comments on commit f7ed5db

Please sign in to comment.