-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'next' into addon-info-forward-ref-opt-in
- Loading branch information
Showing
37 changed files
with
2,050 additions
and
1,087 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
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,40 @@ | ||
import React from 'react'; | ||
import { mount } from 'enzyme'; | ||
import { Provider } from 'react-redux'; | ||
import { ThemeProvider, themes, convert } from '@storybook/theming'; | ||
import HighlightToggle from './HighlightToggle.tsx'; | ||
import store from '../../redux-config.tsx'; | ||
|
||
function ThemedHighlightToggle(props) { | ||
return ( | ||
<ThemeProvider theme={convert(themes.normal)}> | ||
<HighlightToggle {...props} /> | ||
</ThemeProvider> | ||
); | ||
} | ||
|
||
describe('HighlightToggle component', () => { | ||
test('should render', () => { | ||
// given | ||
const wrapper = mount( | ||
<Provider store={store}> | ||
<ThemedHighlightToggle /> | ||
</Provider> | ||
); | ||
|
||
// then | ||
expect(wrapper.exists()).toBe(true); | ||
}); | ||
|
||
test('should match snapshot', () => { | ||
// given | ||
const wrapper = mount( | ||
<Provider store={store}> | ||
<ThemedHighlightToggle /> | ||
</Provider> | ||
); | ||
|
||
// then | ||
expect(wrapper).toMatchSnapshot(); | ||
}); | ||
}); |
Oops, something went wrong.