Skip to content

Commit

Permalink
frontend: Add stories for Footer
Browse files Browse the repository at this point in the history
  • Loading branch information
joaquimrocha committed Jun 22, 2022
1 parent 31c28bd commit ebf5a42
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
46 changes: 46 additions & 0 deletions frontend/src/components/Footer.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { createStore } from '@reduxjs/toolkit';
import { Meta, Story } from '@storybook/react/types-6-0';
import { Provider } from 'react-redux';
import { MemoryRouter } from 'react-router-dom';
import FooterComponent from './Footer';

export default {
title: 'Footer',
component: FooterComponent,
argTypes: {},
decorators: [
Story => {
return (
<MemoryRouter>
<Story />
</MemoryRouter>
);
},
],
} as Meta;

const Template: Story = args => {
// eslint-disable-next-line no-unused-vars
const store = createStore((state = { config: {} }, action) => state, {
config: {
...args,
},
});
return (
<Provider store={store}>
<FooterComponent />
</Provider>
);
};

export const FooterNoOverride = Template.bind({});
FooterNoOverride.args = {
title: '',
nebraska_version: '',
};

export const FooterOverride = Template.bind({});
FooterOverride.args = {
title: 'Some Pro Update Service',
nebraska_version: '1.2.3',
};
25 changes: 25 additions & 0 deletions frontend/src/components/__snapshots__/Footer.stories.storyshot
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Storyshots Footer Footer No Override 1`] = `
<div
id="root"
>
<div
class="MuiBox-root MuiBox-root"
>
Nebraska
</div>
</div>
`;

exports[`Storyshots Footer Footer Override 1`] = `
<div
id="root"
>
<div
class="MuiBox-root MuiBox-root"
>
Some Pro Update Service 1.2.3
</div>
</div>
`;

0 comments on commit ebf5a42

Please sign in to comment.