File tree 6 files changed +119
-509
lines changed
6 files changed +119
-509
lines changed Original file line number Diff line number Diff line change 1
1
## Webpack4 - React16.7 Templater App
2
2
3
3
4
+ # 1.7.1
5
+ * Added Jest dev and peer packages.
6
+ * Fixed Jest testing environment.
7
+ * Minor improvements.
8
+
4
9
# 1.4.0
5
10
* Added Tests example in the App.
6
11
* Fixed animation in App Component.
Original file line number Diff line number Diff line change @@ -18,6 +18,6 @@ module.exports = {
18
18
'^.+\\.jsx?$' : 'babel-jest' ,
19
19
'^.+\\.tsx?$' : 'ts-jest'
20
20
} ,
21
- setupFiles : [ '<rootDir>/setupTests.js' , '<rootDir>/node_modules/whatwg-fetch/fetch.js' ] ,
21
+ setupFiles : [ '<rootDir>/setupTests.js' ] ,
22
22
snapshotSerializers : [ 'enzyme-to-json/serializer' ]
23
23
} ;
Original file line number Diff line number Diff line change 114
114
"eslint-plugin-react" : " ^7.12.1" ,
115
115
"eslint-plugin-react-hooks" : " ^0.0.0" ,
116
116
"husky" : " ^1.3.1" ,
117
+ "identity-obj-proxy" : " ^3.0.0" ,
117
118
"jest" : " ^23.6.0" ,
118
119
"jest-cli" : " ^23.6.0" ,
119
120
"jsonlint" : " ^1.6.3" ,
160
161
"@babel/preset-stage-3" : " ^7.0.0" ,
161
162
"@babel/preset-typescript" : " ^7.1.0" ,
162
163
"awesome-typescript-loader" : " ^5.2.1" ,
164
+ "babel-core" : " ^7.0.0-bridge.0" ,
165
+ "babel-jest" : " ^23.6.0" ,
163
166
"babel-loader" : " ^8.0.5" ,
164
167
"babel-plugin-transform-runtime" : " ^6.23.0" ,
165
168
"babel-polyfill" : " ^6.26.0" ,
169
172
"connect-history-api-fallback" : " ^1.5.0" ,
170
173
"connected-react-router" : " ^6.1.0" ,
171
174
"debug" : " ^4.1.1" ,
175
+ "enzyme-adapter-react-16" : " ^1.7.1" ,
172
176
"eslint-loader" : " ^2.1.1" ,
173
177
"exports-loader" : " ^0.7.0" ,
174
178
"history" : " ^4.7.2" ,
Original file line number Diff line number Diff line change
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports [` <Body Component Test /> should render basic Body Component with an image 1` ] = `
4
+ <Body
5
+ imageToShow = { 3 }
6
+ switchImage = { [Function ]}
7
+ >
8
+ <div
9
+ className = " body"
10
+ >
11
+ <button
12
+ className = " button"
13
+ onClick = { [Function ]}
14
+ type = " button"
15
+ >
16
+ <TransitionGroup
17
+ childFactory = { [Function ]}
18
+ className = " animWrap"
19
+ component = " div"
20
+ >
21
+ <div
22
+ className = " animWrap"
23
+ >
24
+ <CSSTransition
25
+ classNames = " mainImage"
26
+ in = { true }
27
+ key = " .$3"
28
+ onExited = { [Function ]}
29
+ timeout = { 500 }
30
+ >
31
+ <Transition
32
+ appear = { false }
33
+ enter = { true }
34
+ exit = { true }
35
+ in = { true }
36
+ mountOnEnter = { false }
37
+ onEnter = { [Function ]}
38
+ onEntered = { [Function ]}
39
+ onEntering = { [Function ]}
40
+ onExit = { [Function ]}
41
+ onExited = { [Function ]}
42
+ onExiting = { [Function ]}
43
+ timeout = { 500 }
44
+ unmountOnExit = { false }
45
+ >
46
+ <img
47
+ alt = " main_img"
48
+ className = " bodyImg"
49
+ src = " ../assets/3.png"
50
+ />
51
+ </Transition >
52
+ </CSSTransition >
53
+ </div >
54
+ </TransitionGroup >
55
+ </button >
56
+ </div >
57
+ </Body >
58
+ ` ;
Original file line number Diff line number Diff line change @@ -3,14 +3,14 @@ import { mount } from 'enzyme';
3
3
4
4
import initialState from './mocks/body' ;
5
5
6
- import { Body } from '../components' ;
6
+ import Body from '../components/Body ' ;
7
7
8
8
describe ( '<Body Component Test />' , ( ) => {
9
9
it ( 'should render basic Body Component with an image' , ( ) => {
10
10
const Component = mount ( < Body { ...initialState } /> ) ;
11
11
12
12
expect ( Component . find ( '.body' ) . length ) . toBe ( 1 ) ;
13
- expect ( Component . find ( '.bodyImage ' ) . length ) . toBe ( 1 ) ;
13
+ expect ( Component . find ( '.bodyImg ' ) . length ) . toBe ( 1 ) ;
14
14
15
15
expect ( Component ) . toMatchSnapshot ( ) ;
16
16
} ) ;
You can’t perform that action at this time.
0 commit comments