mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-25 05:03:10 +08:00
# Conflicts: # .babelrc.js # addons/a11y/package.json # addons/actions/package.json # addons/backgrounds/package.json # addons/cssresources/package.json # addons/events/package.json # addons/graphql/package.json # addons/info/package.json # addons/info/src/components/PropTable.js # addons/jest/package.json # addons/knobs/package.json # addons/links/package.json # addons/notes/package.json # addons/ondevice-backgrounds/package.json # addons/options/package.json # addons/storyshots/storyshots-core/package.json # addons/storyshots/storyshots-puppeteer/package.json # addons/storysource/package.json # app/angular/package.json # app/ember/package.json # app/html/package.json # app/marko/package.json # app/mithril/package.json # app/polymer/package.json # app/react/package.json # app/riot/package.json # app/svelte/package.json # app/vue/package.json # examples/official-storybook/stories/addon-a11y.stories.js # examples/official-storybook/stories/addon-actions.stories.js # lib/addons/package.json # lib/channel-postmessage/package.json # lib/channel-websocket/package.json # lib/components/package.json # lib/components/src/layout/mobile.js # lib/core/package.json # lib/core/src/server/common/babel.js # lib/ui/package.json # lib/ui/src/modules/ui/components/stories_panel/index.js # lib/ui/src/modules/ui/components/stories_panel/stories_tree/index.test.js # lib/ui/src/modules/ui/components/stories_panel/stories_tree/tree_decorators_utils.js # lib/ui/src/modules/ui/components/stories_panel/text_filter.js # yarn.lock
24 lines
819 B
JavaScript
24 lines
819 B
JavaScript
import { document, setTimeout } from 'global';
|
|
import { storiesOf } from '@storybook/html';
|
|
import { checkA11y } from '@storybook/addon-a11y';
|
|
|
|
const text = 'Testing the a11y addon';
|
|
|
|
storiesOf('Addons|a11y', module)
|
|
.addDecorator(checkA11y)
|
|
.addParameters({ options: { selectedAddonPanel: 'storybook/a11y/panel' } })
|
|
.add('Default', () => `<button></button>`)
|
|
.add('Label', () => `<button>${text}</button>`)
|
|
.add('Disabled', () => `<button disabled>${text}</button>`)
|
|
.add(
|
|
'Invalid contrast',
|
|
() => `<button style="color: black; background-color: brown;">${text}</button>`
|
|
)
|
|
.add('Delayed render', () => {
|
|
const div = document.createElement('div');
|
|
setTimeout(() => {
|
|
div.innerHTML = `<button>This button has a delayed render of 1s</button>`;
|
|
}, 1000);
|
|
return div;
|
|
});
|