-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #612 from kinvolk/fix-empty-version-filtering
frontend: Prevent sending an empty version when fetching instances
- Loading branch information
Showing
3 changed files
with
80 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
25
frontend/src/components/__snapshots__/Footer.stories.storyshot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
`; |