@@ -114,43 +114,15 @@ describe('isActive', function () {
114
114
} )
115
115
} )
116
116
117
- it ( 'is active with trailing slash on pattern ' , function ( done ) {
117
+ it ( 'is active with extraneous slashes ' , function ( done ) {
118
118
render ( (
119
119
< Router history = { createHistory ( '/parent/child' ) } >
120
120
< Route path = "/parent" >
121
121
< Route path = "child" />
122
122
</ Route >
123
123
</ Router >
124
124
) , node , function ( ) {
125
- expect ( this . router . isActive ( '/parent/child/' ) ) . toBe ( true )
126
- done ( )
127
- } )
128
- } )
129
-
130
- it ( 'is active with trailing slash on location' , function ( done ) {
131
- render ( (
132
- < Router history = { createHistory ( '/parent/child/' ) } >
133
- < Route path = "/parent" >
134
- < Route path = "child" />
135
- </ Route >
136
- </ Router >
137
- ) , node , function ( ) {
138
- expect ( this . router . isActive ( '/parent/child' ) ) . toBe ( true )
139
- expect ( this . router . isActive ( '/parent/child/' ) ) . toBe ( true )
140
- done ( )
141
- } )
142
- } )
143
-
144
- it ( 'is not active with extraneous slashes' , function ( done ) {
145
- render ( (
146
- < Router history = { createHistory ( '/parent/child' ) } >
147
- < Route path = "/parent" >
148
- < Route path = "child" />
149
- </ Route >
150
- </ Router >
151
- ) , node , function ( ) {
152
- expect ( this . router . isActive ( '/parent//child' ) ) . toBe ( false )
153
- expect ( this . router . isActive ( '/parent/child//' ) ) . toBe ( false )
125
+ expect ( this . router . isActive ( '/parent////child////' ) ) . toBe ( true )
154
126
done ( )
155
127
} )
156
128
} )
@@ -364,41 +336,7 @@ describe('isActive', function () {
364
336
} )
365
337
} )
366
338
367
- it ( 'is active with trailing slash on pattern' , function ( done ) {
368
- render ( (
369
- < Router history = { createHistory ( '/parent/child' ) } >
370
- < Route path = "/parent" >
371
- < Route path = "child" >
372
- < IndexRoute />
373
- </ Route >
374
- </ Route >
375
- </ Router >
376
- ) , node , function ( ) {
377
- expect ( this . router . isActive ( '/parent/child/' ) ) . toBe ( true )
378
- expect ( this . router . isActive ( '/parent/child/' , true ) ) . toBe ( true )
379
- done ( )
380
- } )
381
- } )
382
-
383
- it ( 'is active with trailing slash on location' , function ( done ) {
384
- render ( (
385
- < Router history = { createHistory ( '/parent/child/' ) } >
386
- < Route path = "/parent" >
387
- < Route path = "child" >
388
- < IndexRoute />
389
- </ Route >
390
- </ Route >
391
- </ Router >
392
- ) , node , function ( ) {
393
- expect ( this . router . isActive ( '/parent/child' ) ) . toBe ( true )
394
- expect ( this . router . isActive ( '/parent/child' , true ) ) . toBe ( true )
395
- expect ( this . router . isActive ( '/parent/child/' ) ) . toBe ( true )
396
- expect ( this . router . isActive ( '/parent/child/' , true ) ) . toBe ( true )
397
- done ( )
398
- } )
399
- } )
400
-
401
- it ( 'is not active with extraneous slashes' , function ( done ) {
339
+ it ( 'is active with extraneous slashes' , function ( done ) {
402
340
render ( (
403
341
< Router history = { createHistory ( '/parent/child' ) } >
404
342
< Route path = "/parent" >
@@ -408,10 +346,8 @@ describe('isActive', function () {
408
346
</ Route >
409
347
</ Router >
410
348
) , node , function ( ) {
411
- expect ( this . router . isActive ( '/parent//child' ) ) . toBe ( false )
412
- expect ( this . router . isActive ( '/parent/child//' ) ) . toBe ( false )
413
- expect ( this . router . isActive ( '/parent//child' , true ) ) . toBe ( false )
414
- expect ( this . router . isActive ( '/parent/child//' , true ) ) . toBe ( false )
349
+ expect ( this . router . isActive ( '/parent///child///' ) ) . toBe ( true )
350
+ expect ( this . router . isActive ( '/parent///child///' , true ) ) . toBe ( true )
415
351
done ( )
416
352
} )
417
353
} )
@@ -436,45 +372,7 @@ describe('isActive', function () {
436
372
} )
437
373
} )
438
374
439
- it ( 'is active with trailing slash on pattern' , function ( done ) {
440
- render ( (
441
- < Router history = { createHistory ( '/parent/child' ) } >
442
- < Route path = "/parent" >
443
- < Route path = "child" >
444
- < Route >
445
- < IndexRoute />
446
- </ Route >
447
- </ Route >
448
- </ Route >
449
- </ Router >
450
- ) , node , function ( ) {
451
- expect ( this . router . isActive ( '/parent/child/' ) ) . toBe ( true )
452
- expect ( this . router . isActive ( '/parent/child/' , true ) ) . toBe ( true )
453
- done ( )
454
- } )
455
- } )
456
-
457
- it ( 'is active with trailing slash on location' , function ( done ) {
458
- render ( (
459
- < Router history = { createHistory ( '/parent/child/' ) } >
460
- < Route path = "/parent" >
461
- < Route path = "child" >
462
- < Route >
463
- < IndexRoute />
464
- </ Route >
465
- </ Route >
466
- </ Route >
467
- </ Router >
468
- ) , node , function ( ) {
469
- expect ( this . router . isActive ( '/parent/child' ) ) . toBe ( true )
470
- expect ( this . router . isActive ( '/parent/child' , true ) ) . toBe ( true )
471
- expect ( this . router . isActive ( '/parent/child/' ) ) . toBe ( true )
472
- expect ( this . router . isActive ( '/parent/child/' , true ) ) . toBe ( true )
473
- done ( )
474
- } )
475
- } )
476
-
477
- it ( 'is not active with extraneous slashes' , function ( done ) {
375
+ it ( 'is active with extraneous slashes' , function ( done ) {
478
376
render ( (
479
377
< Router history = { createHistory ( '/parent/child' ) } >
480
378
< Route path = "/parent" >
@@ -486,10 +384,8 @@ describe('isActive', function () {
486
384
</ Route >
487
385
</ Router >
488
386
) , node , function ( ) {
489
- expect ( this . router . isActive ( '/parent//child' ) ) . toBe ( false )
490
- expect ( this . router . isActive ( '/parent/child//' ) ) . toBe ( false )
491
- expect ( this . router . isActive ( '/parent//child' , true ) ) . toBe ( false )
492
- expect ( this . router . isActive ( '/parent/child//' , true ) ) . toBe ( false )
387
+ expect ( this . router . isActive ( '/parent///child///' ) ) . toBe ( true )
388
+ expect ( this . router . isActive ( '/parent///child///' , true ) ) . toBe ( true )
493
389
done ( )
494
390
} )
495
391
} )
0 commit comments