-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 #1396 from Shopify/themeprovider-new-context
[ThemeProvider] Use the new context api
- Loading branch information
Showing
33 changed files
with
450 additions
and
515 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
21 changes: 21 additions & 0 deletions
21
src/components/AppProvider/utilities/withAppProvider/tests/withAppProvider.test.tsx
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,21 @@ | ||
import * as React from 'react'; | ||
import {mount} from 'enzyme'; | ||
import withAppProvider from '../withAppProvider'; | ||
|
||
describe('withAppProvider', () => { | ||
it('throws when polaris is not defined', () => { | ||
const consoleSpy = jest | ||
.spyOn(console, 'error') | ||
.mockImplementation(() => {}); | ||
|
||
const Child: React.SFC<{}> = (_props) => <div />; | ||
|
||
const WrappedComponent = withAppProvider<any>()(Child); | ||
|
||
const fn = () => { | ||
mount(<WrappedComponent />); | ||
consoleSpy.mockRestore(); | ||
}; | ||
expect(fn).toThrowError(); | ||
}); | ||
}); |
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
Oops, something went wrong.