@@ -45,6 +45,28 @@ describe('chai', () => {
4545 . to . dispatch . actions ( actions . expectedParentActions , done ) ;
4646 } ) ;
4747 } ) ;
48+
49+ describe ( '.not.dispatch.actions' , ( ) => {
50+ it ( 'should accept single action' , ( done ) => {
51+ expect ( actions . start ( ) )
52+ . to . not . dispatch . actions ( actions . anotherStart ( ) , done ) ;
53+ } ) ;
54+
55+ it ( 'should accept array with one action' , ( done ) => {
56+ expect ( actions . start ( ) )
57+ . to . not . dispatch . actions ( [ actions . anotherStart ( ) ] , done ) ;
58+ } ) ;
59+
60+ it ( 'should accept array with multiple actions' , ( done ) => {
61+ expect ( actions . asyncActionCreator ( ) )
62+ . to . not . dispatch . actions ( actions . anotherExpectedActions , done ) ;
63+ } ) ;
64+
65+ it ( 'should accept array with nested async action creators' , ( done ) => {
66+ expect ( actions . parentAsyncActionCreator ( ) )
67+ . to . not . dispatch . actions ( actions . anotherParentExpectedActions , done ) ;
68+ } ) ;
69+ } ) ;
4870 } ) ;
4971
5072 describe ( 'should' , ( ) => {
@@ -83,6 +105,28 @@ describe('chai', () => {
83105 . dispatch . actions ( actions . expectedParentActions , done ) ;
84106 } ) ;
85107 } ) ;
108+
109+ describe ( '.not.dispath.actions' , ( ) => {
110+ it ( 'should accept single action' , ( done ) => {
111+ actions . start ( ) . should
112+ . not . dispatch . actions ( actions . anotherStart ( ) , done ) ;
113+ } ) ;
114+
115+ it ( 'should accept array with one action' , ( done ) => {
116+ actions . start ( ) . should
117+ . not . dispatch . actions ( [ actions . anotherStart ( ) ] , done ) ;
118+ } ) ;
119+
120+ it ( 'should accept array with multiple actions' , ( done ) => {
121+ actions . asyncActionCreator ( ) . should
122+ . not . dispatch . actions ( actions . anotherExpectedActions , done ) ;
123+ } ) ;
124+
125+ it ( 'should accept array with nested async action creators' , ( done ) => {
126+ actions . parentAsyncActionCreator ( ) . should
127+ . not . dispatch . actions ( actions . anotherParentExpectedActions , done ) ;
128+ } ) ;
129+ } ) ;
86130 } ) ;
87131
88132 describe ( 'assert' , ( ) => {
@@ -106,6 +150,26 @@ describe('chai', () => {
106150 } ) ;
107151 } ) ;
108152
153+ describe ( 'isNotDispatchingWithState' , ( ) => {
154+ it ( 'should accept object as third argument' , ( done ) => {
155+ assert . isNotDispatchingWithState (
156+ actions . actionCreatorWithGetState ( ) ,
157+ actions . actionWithGetState ( { property : 'anotherParentAsyncActionCreator' } ) ,
158+ { property : 'value' } ,
159+ done
160+ ) ;
161+ } ) ;
162+
163+ it ( 'should accept function as third argument' , ( done ) => {
164+ assert . isNotDispatchingWithState (
165+ actions . actionCreatorWithGetState ( ) ,
166+ actions . actionWithGetState ( { property : 'anotherValue' } ) ,
167+ ( ) => { return { property : 'value' } ; } ,
168+ done
169+ ) ;
170+ } ) ;
171+ } ) ;
172+
109173 describe ( 'isDispatching' , ( ) => {
110174 it ( 'should accept single action' , ( done ) => {
111175 assert . isDispatching (
@@ -139,5 +203,39 @@ describe('chai', () => {
139203 ) ;
140204 } ) ;
141205 } ) ;
206+
207+ describe ( 'isNotDispatching' , ( ) => {
208+ it ( 'should accept single action' , ( done ) => {
209+ assert . isNotDispatching (
210+ actions . start ( ) ,
211+ actions . anotherStart ( ) ,
212+ done
213+ ) ;
214+ } ) ;
215+
216+ it ( 'should accept array with one action' , ( done ) => {
217+ assert . isNotDispatching (
218+ actions . start ( ) ,
219+ [ actions . anotherStart ( ) ] ,
220+ done
221+ ) ;
222+ } ) ;
223+
224+ it ( 'should accept array with multiple actions' , ( done ) => {
225+ assert . isNotDispatching (
226+ actions . asyncActionCreator ( ) ,
227+ actions . anotherExpectedActions ,
228+ done
229+ ) ;
230+ } ) ;
231+
232+ it ( 'should accept array with nested async action creators' , ( done ) => {
233+ assert . isNotDispatching (
234+ actions . parentAsyncActionCreator ( ) ,
235+ actions . anotherParentExpectedActions ,
236+ done
237+ ) ;
238+ } ) ;
239+ } ) ;
142240 } ) ;
143241} ) ;
0 commit comments