From ebf5a4202037386d172e48788ba05245a9d5195c Mon Sep 17 00:00:00 2001 From: Joaquim Rocha Date: Wed, 22 Jun 2022 21:03:48 +0100 Subject: [PATCH] frontend: Add stories for Footer --- frontend/src/components/Footer.stories.tsx | 46 +++++++++++++++++++ .../__snapshots__/Footer.stories.storyshot | 25 ++++++++++ 2 files changed, 71 insertions(+) create mode 100644 frontend/src/components/Footer.stories.tsx create mode 100644 frontend/src/components/__snapshots__/Footer.stories.storyshot diff --git a/frontend/src/components/Footer.stories.tsx b/frontend/src/components/Footer.stories.tsx new file mode 100644 index 000000000..613ceb684 --- /dev/null +++ b/frontend/src/components/Footer.stories.tsx @@ -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 ( + + + + ); + }, + ], +} as Meta; + +const Template: Story = args => { + // eslint-disable-next-line no-unused-vars + const store = createStore((state = { config: {} }, action) => state, { + config: { + ...args, + }, + }); + return ( + + + + ); +}; + +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', +}; diff --git a/frontend/src/components/__snapshots__/Footer.stories.storyshot b/frontend/src/components/__snapshots__/Footer.stories.storyshot new file mode 100644 index 000000000..b92938b3a --- /dev/null +++ b/frontend/src/components/__snapshots__/Footer.stories.storyshot @@ -0,0 +1,25 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Storyshots Footer Footer No Override 1`] = ` +
+
+ Nebraska +
+
+`; + +exports[`Storyshots Footer Footer Override 1`] = ` +
+
+ Some Pro Update Service 1.2.3 +
+
+`;