-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
151 additions
and
29 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
47 changes: 40 additions & 7 deletions
47
frontend/app/components/LangMenu/tests/__snapshots__/index.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 |
---|---|---|
@@ -1,13 +1,46 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`ReactMediumEditor Component 1`] = ` | ||
<div | ||
dangerouslySetInnerHTML={ | ||
exports[`LangMenu Component 1`] = ` | ||
<Context.Provider | ||
value={ | ||
Object { | ||
"__html": "<p>Test</p>", | ||
"store": Object { | ||
"clearActions": [Function], | ||
"dispatch": [Function], | ||
"getActions": [Function], | ||
"getState": [Function], | ||
"replaceReducer": [Function], | ||
"subscribe": [Function], | ||
}, | ||
"subscription": Subscription { | ||
"handleChangeWrapper": [Function], | ||
"listeners": Object { | ||
"notify": [Function], | ||
}, | ||
"onStateChange": [Function], | ||
"parentSub": undefined, | ||
"store": Object { | ||
"clearActions": [Function], | ||
"dispatch": [Function], | ||
"getActions": [Function], | ||
"getState": [Function], | ||
"replaceReducer": [Function], | ||
"subscribe": [Function], | ||
}, | ||
"unsubscribe": null, | ||
}, | ||
} | ||
} | ||
onLanguagesChange={[Function]} | ||
selectedLanguages={[Array]} | ||
/> | ||
> | ||
<Memo(ConnectFunction) | ||
onLanguagesChange={[Function]} | ||
selectedLanguagegs={ | ||
Array [ | ||
"python", | ||
"javascript", | ||
"c++", | ||
] | ||
} | ||
/> | ||
</Context.Provider> | ||
`; |
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 |
---|---|---|
@@ -1,13 +1,22 @@ | ||
import React from 'react'; | ||
import renderer from 'react-test-renderer'; | ||
import { Provider } from 'react-redux'; | ||
import ShallowRenderer from 'react-test-renderer/shallow'; | ||
import configureMockStore from 'redux-mock-store'; | ||
import LangMenu from '../LangMenu'; | ||
|
||
const mockStore = configureMockStore(); | ||
const store = mockStore({}); | ||
|
||
const renderer = new ShallowRenderer(); | ||
|
||
test('LangMenu Component', () => { | ||
const component = renderer.create( | ||
<LangMenu | ||
onLanguagesChange={value => value} | ||
selectedLanguagegs={['python', 'javascript', 'c++']} | ||
/>, | ||
const page = renderer.render( | ||
<Provider store={store}> | ||
<LangMenu | ||
onLanguagesChange={value => value} | ||
selectedLanguagegs={['python', 'javascript', 'c++']} | ||
/> | ||
</Provider>, | ||
); | ||
expect(component.toJSON()).toMatchSnapshot(); | ||
expect(page).toMatchSnapshot(); | ||
}); |
48 changes: 48 additions & 0 deletions
48
frontend/app/components/ProfileCard/tests/__snapshots__/index.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,48 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`ProfileCard Component 1`] = ` | ||
<Context.Provider | ||
value={ | ||
Object { | ||
"store": Object { | ||
"clearActions": [Function], | ||
"dispatch": [Function], | ||
"getActions": [Function], | ||
"getState": [Function], | ||
"replaceReducer": [Function], | ||
"subscribe": [Function], | ||
}, | ||
"subscription": Subscription { | ||
"handleChangeWrapper": [Function], | ||
"listeners": Object { | ||
"notify": [Function], | ||
}, | ||
"onStateChange": [Function], | ||
"parentSub": undefined, | ||
"store": Object { | ||
"clearActions": [Function], | ||
"dispatch": [Function], | ||
"getActions": [Function], | ||
"getState": [Function], | ||
"replaceReducer": [Function], | ||
"subscribe": [Function], | ||
}, | ||
"unsubscribe": null, | ||
}, | ||
} | ||
} | ||
> | ||
<ForwardRef(WithStyles) | ||
email="[email protected]" | ||
languages={ | ||
Array [ | ||
"python", | ||
"javascript", | ||
"c++", | ||
] | ||
} | ||
name="Name" | ||
onLanguagesChange={[Function]} | ||
/> | ||
</Context.Provider> | ||
`; |
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 |
---|---|---|
@@ -1,14 +1,24 @@ | ||
import React from 'react'; | ||
import renderer from 'react-test-renderer'; | ||
import { Provider } from 'react-redux'; | ||
import ShallowRenderer from 'react-test-renderer/shallow'; | ||
import configureMockStore from 'redux-mock-store'; | ||
import ProfileCard from '../ProfileCard'; | ||
|
||
test('Group Dashboard Component', () => { | ||
const component = renderer.create( | ||
<ProfileCard | ||
name="Name" | ||
email="[email protected]" | ||
languages={['python', 'javascript', 'c++']} | ||
/>, | ||
const mockStore = configureMockStore(); | ||
const store = mockStore({}); | ||
|
||
const renderer = new ShallowRenderer(); | ||
|
||
test('ProfileCard Component', () => { | ||
const page = renderer.render( | ||
<Provider store={store}> | ||
<ProfileCard | ||
name="Name" | ||
email="[email protected]" | ||
languages={['python', 'javascript', 'c++']} | ||
onLanguagesChange={value => value} | ||
/> | ||
</Provider>, | ||
); | ||
expect(component.toJSON()).toMatchSnapshot(); | ||
expect(page).toMatchSnapshot(); | ||
}); |
32 changes: 27 additions & 5 deletions
32
frontend/app/containers/NotFoundPage/tests/__snapshots__/index.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 |
---|---|---|
@@ -1,9 +1,31 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`<NotFoundPage /> should render and match the snapshot 1`] = ` | ||
<h1> | ||
<span> | ||
This is the NotFoundPage container! | ||
</span> | ||
</h1> | ||
<span> | ||
<div | ||
class="background" | ||
> | ||
<div | ||
class="centerbox" | ||
> | ||
<h1> | ||
Django Mango | ||
</h1> | ||
<h2> | ||
404 Error. | ||
</h2> | ||
<h2 | ||
href="/" | ||
> | ||
The requested URL was not found on this server. | ||
</h2> | ||
<a | ||
class="link" | ||
href="/" | ||
> | ||
Return to Login. | ||
</a> | ||
</div> | ||
</div> | ||
</span> | ||
`; |