Add CssBaseline decorator and Roboto to Storybook

This commit is contained in:
Eric Schultz 2021-03-09 19:08:06 -06:00 committed by Eric Schultz
parent b519c9f3b5
commit 1fa6d70cb0
3 changed files with 23 additions and 1 deletions

View file

@ -1,6 +1,11 @@
// License: LGPL-3.0-or-later // License: LGPL-3.0-or-later
import intlDecorate from '../../app/javascript/components/tests/intl'; import intlDecorate from '../../app/javascript/components/tests/intl';
import cssBaseline from '../../app/javascript/components/tests/decorators/baseline'
import '../../app/javascript/components/tests/decorators/roboto'
const jest = require('jest-mock'); const jest = require('jest-mock');
window.jest = jest; window.jest = jest;
export const decorators = [intlDecorate()]
export const decorators = [intlDecorate(), cssBaseline()]

View file

@ -0,0 +1,16 @@
import React from 'react';
import CssBaseline from '@material-ui/core/CssBaseline';
import type {DecoratorFn} from '@storybook/react';
import { StoryFn } from '@storybook/addons';
function decorator(story:StoryFn<JSX.Element>): JSX.Element {
return (<>
<CssBaseline/>
{story()}
</>);
}
export default function decorate(): DecoratorFn {
return decorator;
}

View file

@ -0,0 +1 @@
import 'fontsource-roboto';