Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #24480 - fix org switching on subs page
- Loading branch information
Showing
5 changed files
with
79 additions
and
11 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
19 changes: 19 additions & 0 deletions
19
webpack/components/WithOrganization/__snapshots__/withOrganization.test.js.snap
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,19 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`subscriptions page should render select org page 1`] = ` | ||
<CheckOrg> | ||
<Connect(withRouter(SetOrganization)) | ||
redirectPath="/test" | ||
/> | ||
</CheckOrg> | ||
`; | ||
|
||
exports[`subscriptions page should render the wrapped component 1`] = ` | ||
<CheckOrg> | ||
<WrappedComponent> | ||
<div> | ||
Wrapped! | ||
</div> | ||
</WrappedComponent> | ||
</CheckOrg> | ||
`; |
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
27 changes: 27 additions & 0 deletions
27
webpack/components/WithOrganization/withOrganization.test.js
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,27 @@ | ||
import React from 'react'; | ||
import { mount } from 'enzyme'; | ||
import toJson from 'enzyme-to-json'; | ||
import withOrganization from './withOrganization'; | ||
|
||
jest.mock('../SelectOrg/SetOrganization'); | ||
jest.mock('../../helpers/caret'); | ||
|
||
describe('subscriptions page', () => { | ||
const WrappedComponent = () => <div> Wrapped! </div>; | ||
|
||
it('should render the wrapped component', () => { | ||
global.document.getElementById = () => ({ dataset: { id: 1 } }); | ||
|
||
const Component = withOrganization(WrappedComponent, '/test'); | ||
const page = mount(<Component />); | ||
expect(toJson(page)).toMatchSnapshot(); | ||
}); | ||
|
||
it('should render select org page', () => { | ||
global.document.getElementById = () => ({ dataset: { id: '' } }); | ||
|
||
const Component = withOrganization(WrappedComponent, '/test'); | ||
const page = mount(<Component />); | ||
expect(toJson(page)).toMatchSnapshot(); | ||
}); | ||
}); |
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