import React from 'react';
import Faker from 'faker';
import { storiesOf } from '@storybook/react';
import { setOptions } from '@storybook/addon-options';
import { checkA11y } from '@storybook/addon-a11y';
import BaseButton from '../components/BaseButton';
import DelayedRender from '../components/DelayedRender';
import Button from '../components/addon-a11y/Button';
import Image from '../components/addon-a11y/Image';
import * as Form from '../components/addon-a11y/Form';
import * as Typography from '../components/addon-a11y/Typography';
const text = 'Testing the a11y addon';
storiesOf('Addons|a11y', module)
.addDecorator(checkA11y)
.addDecorator(fn => {
setOptions({ selectedAddonPanel: '@storybook/addon-a11y/panel' });
return fn();
})
.add('Default', () => )
.add('Label', () => )
.add('Disabled', () => )
.add('Invalid contrast', () => (
// FIXME has no effect on score
))
.add('delayed render', () => (
));
storiesOf('Addons|a11y/Button', module)
.addDecorator(checkA11y)
.add('Default', () => )
.add('Content', () => )
.add('Label', () => )
.add('Disabled', () => )
.add('Invalid contrast', () => );
const label = Faker.lorem.word();
const placeholder = Faker.lorem.word();
storiesOf('Addons|a11y/Form', module)
.addDecorator(checkA11y)
.add('Without Label', () =>
} />)
.add('With label', () => (
} input={} />
))
.add('With placeholder', () => (
} />
));
const image = Faker.image.animals();
const alt = Faker.lorem.words();
storiesOf('Addons|a11y/Image', module)
.addDecorator(checkA11y)
.add('Without alt', () => )
.add('With alt', () => )
.add('Presentation', () => );
// eslint-disable-next-line no-script-url
const href = 'javascript:void 0';
storiesOf('Addons|a11y/Typography', module)
.addDecorator(checkA11y)
.add('Correct', () => (
{Faker.lorem.sentence()}
{Faker.lorem.paragraph()}
))
.add('Empty Heading', () => )
.add('Empty Paragraph', () => )
.add('Empty Link', () => )
.add('Link without href', () => );