-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add dependency on jest-enzyme * add test for AppContainer + navigation * fix lint warnings in app-container.test * add lint file for web/__tests__ * make circleci run tests one at a time
- Loading branch information
Showing
5 changed files
with
82 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,4 +18,4 @@ dependencies: | |
|
||
test: | ||
override: | ||
- yarn test | ||
- yarn test -- --runInBand |
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 @@ | ||
extends: ../../../.eslintrc-test.yml |
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,36 @@ | ||
// @flow | ||
|
||
import React from 'react' | ||
import { mount } from 'enzyme' | ||
|
||
import configureStore from '../redux' | ||
import ReduxWrapper from '../redux-wrapper' | ||
import Router from 'react-router/lib/Router' | ||
import { createMemoryHistory } from 'history' | ||
import routes from '../routes' | ||
|
||
import debug from 'debug' | ||
debug.enable('foo') | ||
|
||
test('AppContainer renders', () => { | ||
mount( | ||
<ReduxWrapper store={configureStore()}> | ||
<Router history={createMemoryHistory()} routes={routes} /> | ||
</ReduxWrapper> | ||
) | ||
}) | ||
|
||
test('AppContainer can navigate to /create', () => { | ||
const store = configureStore() | ||
const history = createMemoryHistory() | ||
|
||
const app = mount( | ||
<ReduxWrapper store={store}> | ||
<Router history={history} routes={routes} /> | ||
</ReduxWrapper> | ||
) | ||
|
||
history.push('/create') | ||
|
||
expect(app.find('h1').text()).toEqual('Hi there!') | ||
}) |
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 |
---|---|---|
|
@@ -1752,6 +1752,12 @@ deep-eql@^0.1.3: | |
dependencies: | ||
type-detect "0.1.1" | ||
|
||
deep-equal-ident@^1.1.1: | ||
version "1.1.1" | ||
resolved "https://registry.yarnpkg.com/deep-equal-ident/-/deep-equal-ident-1.1.1.tgz#06f4b89e53710cd6cea4a7781c7a956642de8dc9" | ||
dependencies: | ||
lodash.isequal "^3.0" | ||
|
||
deep-extend@~0.4.0: | ||
version "0.4.1" | ||
resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.4.1.tgz#efe4113d08085f4e6f9687759810f807469e2253" | ||
|
@@ -1964,6 +1970,12 @@ entities@^1.1.1, entities@~1.1.1: | |
version "1.1.1" | ||
resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.1.tgz#6e5c2d0a5621b5dadaecef80b90edfb5cd7772f0" | ||
|
||
enzyme-matchers@^2.1.2: | ||
version "2.1.2" | ||
resolved "https://registry.yarnpkg.com/enzyme-matchers/-/enzyme-matchers-2.1.2.tgz#da2c20c3d55b128db3de6a5016f2531066b8061f" | ||
dependencies: | ||
deep-equal-ident "^1.1.1" | ||
|
||
[email protected]: | ||
version "2.7.1" | ||
resolved "https://registry.yarnpkg.com/enzyme/-/enzyme-2.7.1.tgz#76370e1d99e91f73091bb8c4314b7c128cc2d621" | ||
|
@@ -3396,6 +3408,12 @@ jest-environment-node@^19.0.2: | |
jest-mock "^19.0.0" | ||
jest-util "^19.0.2" | ||
|
||
[email protected]: | ||
version "2.1.2" | ||
resolved "https://registry.yarnpkg.com/jest-enzyme/-/jest-enzyme-2.1.2.tgz#707187aabef9fbb7d018c1a2853ee9d8674ba629" | ||
dependencies: | ||
enzyme-matchers "^2.1.2" | ||
|
||
jest-file-exists@^19.0.0: | ||
version "19.0.0" | ||
resolved "https://registry.yarnpkg.com/jest-file-exists/-/jest-file-exists-19.0.0.tgz#cca2e587a11ec92e24cfeab3f8a94d657f3fceb8" | ||
|
@@ -3751,6 +3769,18 @@ lodash._basefor@^3.0.0: | |
version "3.0.3" | ||
resolved "https://registry.yarnpkg.com/lodash._basefor/-/lodash._basefor-3.0.3.tgz#7550b4e9218ef09fad24343b612021c79b4c20c2" | ||
|
||
lodash._baseisequal@^3.0.0: | ||
version "3.0.7" | ||
resolved "https://registry.yarnpkg.com/lodash._baseisequal/-/lodash._baseisequal-3.0.7.tgz#d8025f76339d29342767dcc887ce5cb95a5b51f1" | ||
dependencies: | ||
lodash.isarray "^3.0.0" | ||
lodash.istypedarray "^3.0.0" | ||
lodash.keys "^3.0.0" | ||
|
||
lodash._bindcallback@^3.0.0: | ||
version "3.0.1" | ||
resolved "https://registry.yarnpkg.com/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz#e531c27644cf8b57a99e17ed95b35c748789392e" | ||
|
||
lodash._getnative@^3.0.0: | ||
version "3.9.1" | ||
resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5" | ||
|
@@ -3807,6 +3837,13 @@ lodash.isarray@^3.0.0: | |
version "3.0.4" | ||
resolved "https://registry.yarnpkg.com/lodash.isarray/-/lodash.isarray-3.0.4.tgz#79e4eb88c36a8122af86f844aa9bcd851b5fbb55" | ||
|
||
lodash.isequal@^3.0: | ||
version "3.0.4" | ||
resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-3.0.4.tgz#1c35eb3b6ef0cd1ff51743e3ea3cf7fdffdacb64" | ||
dependencies: | ||
lodash._baseisequal "^3.0.0" | ||
lodash._bindcallback "^3.0.0" | ||
|
||
lodash.isplainobject@^3.2.0: | ||
version "3.2.0" | ||
resolved "https://registry.yarnpkg.com/lodash.isplainobject/-/lodash.isplainobject-3.2.0.tgz#9a8238ae16b200432960cd7346512d0123fbf4c5" | ||
|
@@ -3815,7 +3852,11 @@ lodash.isplainobject@^3.2.0: | |
lodash.isarguments "^3.0.0" | ||
lodash.keysin "^3.0.0" | ||
|
||
lodash.keys@^3.1.2: | ||
lodash.istypedarray@^3.0.0: | ||
version "3.0.6" | ||
resolved "https://registry.yarnpkg.com/lodash.istypedarray/-/lodash.istypedarray-3.0.6.tgz#c9a477498607501d8e8494d283b87c39281cef62" | ||
|
||
lodash.keys@^3.0.0, lodash.keys@^3.1.2: | ||
version "3.1.2" | ||
resolved "https://registry.yarnpkg.com/lodash.keys/-/lodash.keys-3.1.2.tgz#4dbc0472b156be50a0b286855d1bd0b0c656098a" | ||
dependencies: | ||
|