diff --git a/frontend/app/components/LangMenu/LangMenu.js b/frontend/app/components/LangMenu/LangMenu.js index b82b8d1..00784a8 100644 --- a/frontend/app/components/LangMenu/LangMenu.js +++ b/frontend/app/components/LangMenu/LangMenu.js @@ -9,7 +9,7 @@ import MultiSelect from '@khanacademy/react-multi-select'; function createOptions(list) { const output = []; - list.forEach(function(element) { + list.forEach(function options(element) { output.push({ label: element, value: element }); }); return output; diff --git a/frontend/app/components/LangMenu/tests/__snapshots__/index.test.js.snap b/frontend/app/components/LangMenu/tests/__snapshots__/index.test.js.snap index 10ee0ff..2e6f95d 100644 --- a/frontend/app/components/LangMenu/tests/__snapshots__/index.test.js.snap +++ b/frontend/app/components/LangMenu/tests/__snapshots__/index.test.js.snap @@ -1,13 +1,46 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`ReactMediumEditor Component 1`] = ` -
Test

", + "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]} -/> +> + + `; diff --git a/frontend/app/components/LangMenu/tests/index.test.js b/frontend/app/components/LangMenu/tests/index.test.js index e5dd9df..00579cb 100644 --- a/frontend/app/components/LangMenu/tests/index.test.js +++ b/frontend/app/components/LangMenu/tests/index.test.js @@ -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( - value} - selectedLanguagegs={['python', 'javascript', 'c++']} - />, + const page = renderer.render( + + value} + selectedLanguagegs={['python', 'javascript', 'c++']} + /> + , ); - expect(component.toJSON()).toMatchSnapshot(); + expect(page).toMatchSnapshot(); }); diff --git a/frontend/app/components/ProfileCard/tests/__snapshots__/index.test.js.snap b/frontend/app/components/ProfileCard/tests/__snapshots__/index.test.js.snap new file mode 100644 index 0000000..e089e75 --- /dev/null +++ b/frontend/app/components/ProfileCard/tests/__snapshots__/index.test.js.snap @@ -0,0 +1,48 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`ProfileCard Component 1`] = ` + + + +`; diff --git a/frontend/app/components/ProfileCard/tests/index.test.js b/frontend/app/components/ProfileCard/tests/index.test.js index 020f5b8..8e8a465 100644 --- a/frontend/app/components/ProfileCard/tests/index.test.js +++ b/frontend/app/components/ProfileCard/tests/index.test.js @@ -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( - , +const mockStore = configureMockStore(); +const store = mockStore({}); + +const renderer = new ShallowRenderer(); + +test('ProfileCard Component', () => { + const page = renderer.render( + + value} + /> + , ); - expect(component.toJSON()).toMatchSnapshot(); + expect(page).toMatchSnapshot(); }); diff --git a/frontend/app/containers/NotFoundPage/tests/__snapshots__/index.test.js.snap b/frontend/app/containers/NotFoundPage/tests/__snapshots__/index.test.js.snap index c1ed4a7..59dd13f 100644 --- a/frontend/app/containers/NotFoundPage/tests/__snapshots__/index.test.js.snap +++ b/frontend/app/containers/NotFoundPage/tests/__snapshots__/index.test.js.snap @@ -1,9 +1,31 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[` should render and match the snapshot 1`] = ` -

- - This is the NotFoundPage container! - -

+ +
+
+

+ Django Mango +

+

+ 404 Error. +

+

+ The requested URL was not found on this server. +

+ + Return to Login. + +
+
+
`;