@@ -54,7 +54,7 @@ describe('dom', () => {
54
54
</ Router >
55
55
</ div >
56
56
) ;
57
- onChange . reset ( ) ;
57
+ onChange . resetHistory ( ) ;
58
58
$ ( 'a' ) . click ( ) ;
59
59
expect ( onChange )
60
60
. to . have . been . calledOnce
@@ -73,7 +73,7 @@ describe('dom', () => {
73
73
</ Router >
74
74
</ div >
75
75
) ;
76
- onChange . reset ( ) ;
76
+ onChange . resetHistory ( ) ;
77
77
$ ( 'a' ) . click ( ) ;
78
78
// fireEvent($('a'), 'click');
79
79
expect ( onChange )
@@ -91,7 +91,7 @@ describe('dom', () => {
91
91
</ Router >
92
92
</ div >
93
93
) ;
94
- onChange . reset ( ) ;
94
+ onChange . resetHistory ( ) ;
95
95
$ ( 'a' ) . click ( ) ;
96
96
expect ( onChange ) . not . to . have . been . called ;
97
97
expect ( location . href ) . to . contain ( '#foo' ) ;
@@ -143,7 +143,7 @@ describe('dom', () => {
143
143
expect ( A . prototype . componentWillMount ) . not . to . have . been . called ;
144
144
route ( '/a' ) ;
145
145
expect ( A . prototype . componentWillMount ) . to . have . been . calledOnce ;
146
- A . prototype . componentWillMount . reset ( ) ;
146
+ A . prototype . componentWillMount . resetHistory ( ) ;
147
147
expect ( location . pathname ) . to . equal ( '/b' ) ;
148
148
setTimeout ( ( ) => {
149
149
expect ( A . prototype . componentWillMount ) . not . to . have . been . called ;
@@ -171,7 +171,7 @@ describe('dom', () => {
171
171
expect ( routerRef . base . outerHTML ) . to . eql ( '<p>bar is </p>' ) ;
172
172
} ) ;
173
173
} ) ;
174
-
174
+
175
175
describe ( 'preact-router/match' , ( ) => {
176
176
describe ( '<Match>' , ( ) => {
177
177
it ( 'should invoke child function with match status when routing' , done => {
@@ -184,35 +184,35 @@ describe('dom', () => {
184
184
< Match path = "/bar" > { spy2 } </ Match >
185
185
</ div >
186
186
) ;
187
-
187
+
188
188
expect ( spy1 , 'spy1 /foo' ) . to . have . been . calledOnce . and . calledWithMatch ( { matches : false , path :'/' , url :'/' } ) ;
189
189
expect ( spy2 , 'spy2 /foo' ) . to . have . been . calledOnce . and . calledWithMatch ( { matches : false , path :'/' , url :'/' } ) ;
190
-
191
- spy1 . reset ( ) ;
192
- spy2 . reset ( ) ;
193
-
190
+
191
+ spy1 . resetHistory ( ) ;
192
+ spy2 . resetHistory ( ) ;
193
+
194
194
route ( '/foo' ) ;
195
-
195
+
196
196
setTimeout ( ( ) => {
197
197
expect ( spy1 , 'spy1 /foo' ) . to . have . been . calledOnce . and . calledWithMatch ( { matches : true , path :'/foo' , url :'/foo' } ) ;
198
198
expect ( spy2 , 'spy2 /foo' ) . to . have . been . calledOnce . and . calledWithMatch ( { matches : false , path :'/foo' , url :'/foo' } ) ;
199
- spy1 . reset ( ) ;
200
- spy2 . reset ( ) ;
201
-
199
+ spy1 . resetHistory ( ) ;
200
+ spy2 . resetHistory ( ) ;
201
+
202
202
route ( '/foo?bar=5' ) ;
203
203
204
204
setTimeout ( ( ) => {
205
205
expect ( spy1 , 'spy1 /foo?bar=5' ) . to . have . been . calledOnce . and . calledWithMatch ( { matches : true , path :'/foo' , url :'/foo?bar=5' } ) ;
206
206
expect ( spy2 , 'spy2 /foo?bar=5' ) . to . have . been . calledOnce . and . calledWithMatch ( { matches : false , path :'/foo' , url :'/foo?bar=5' } ) ;
207
- spy1 . reset ( ) ;
208
- spy2 . reset ( ) ;
207
+ spy1 . resetHistory ( ) ;
208
+ spy2 . resetHistory ( ) ;
209
209
210
210
route ( '/bar' ) ;
211
-
211
+
212
212
setTimeout ( ( ) => {
213
213
expect ( spy1 , 'spy1 /bar' ) . to . have . been . calledOnce . and . calledWithMatch ( { matches : false , path :'/bar' , url :'/bar' } ) ;
214
214
expect ( spy2 , 'spy2 /bar' ) . to . have . been . calledOnce . and . calledWithMatch ( { matches : true , path :'/bar' , url :'/bar' } ) ;
215
-
215
+
216
216
done ( ) ;
217
217
} , 20 ) ;
218
218
} , 20 ) ;
@@ -230,7 +230,7 @@ describe('dom', () => {
230
230
</ div >
231
231
) ;
232
232
route ( '/foo' ) ;
233
-
233
+
234
234
setTimeout ( ( ) => {
235
235
expect ( scratch . innerHTML ) . to . eql ( '<div><a class="active">foo</a><a class="bar">bar</a></div>' ) ;
236
236
@@ -243,7 +243,7 @@ describe('dom', () => {
243
243
244
244
setTimeout ( ( ) => {
245
245
expect ( scratch . innerHTML ) . to . eql ( '<div><a class="">foo</a><a class="bar active">bar</a></div>' ) ;
246
-
246
+
247
247
done ( ) ;
248
248
} ) ;
249
249
} ) ;
0 commit comments