File tree Expand file tree Collapse file tree 3 files changed +56
-3
lines changed
Expand file tree Collapse file tree 3 files changed +56
-3
lines changed Original file line number Diff line number Diff line change 11
2- /*
3- */
4-
52const initialState = {
63 data : null ,
74 text : '' ,
Original file line number Diff line number Diff line change 1+ import expect from 'expect' ;
2+
3+ import { updateText } from '../src/actions/index'
4+
5+ let params = [
6+ {
7+ title : 'updateText' ,
8+ actual : updateText ( 'abc' ) . type ,
9+ expected : 'UPDATE_TEXT'
10+ }
11+ ] ;
12+
13+ describe ( 'actions' , ( ) => {
14+ params . forEach ( ( param ) => {
15+ it ( param . title , ( ) => {
16+ expect ( param . actual ) . toEqual ( param . expected ) ;
17+ } ) ;
18+ } ) ;
19+ } ) ;
Original file line number Diff line number Diff line change 1+ import expect from 'expect' ;
2+
3+ import { updateText , clearText } from '../src/actions'
4+ import reducer from '../src/reducers'
5+
6+ const params = [
7+ {
8+ title : 'updateText' ,
9+ action : updateText ( 'abc' ) ,
10+ expected : {
11+ data : null ,
12+ text : 'abc' ,
13+ autoFormat : false
14+ }
15+ } ,
16+ {
17+ title : 'clearText' ,
18+ action : clearText ( ) ,
19+ expected : {
20+ data : null ,
21+ text : '' ,
22+ autoFormat : false
23+ }
24+ }
25+ ]
26+
27+
28+ describe ( 'reducer' , ( ) => {
29+
30+ let state = undefined
31+
32+ params . forEach ( ( param ) => {
33+ it ( param . title , ( ) => {
34+ expect ( reducer ( state , param . action ) ) . toEqual ( param . expected ) ;
35+ } ) ;
36+ } ) ;
37+ } ) ;
You can’t perform that action at this time.
0 commit comments