File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -76,14 +76,17 @@ describe('Route utils', () => {
76
76
} )
77
77
78
78
it ( 'trailing slash' , ( ) => {
79
- const a = { path : 'user/1' }
80
- const b = { path : 'user/10' }
81
- const c = { path : 'user/10/' }
82
- const d = { path : 'user/1/' }
79
+ const a = { path : '/users' }
80
+ const b = { path : '/user' }
81
+ const c = { path : '/users/' }
83
82
expect ( isIncludedRoute ( a , b ) ) . toBe ( false )
84
- expect ( isIncludedRoute ( a , c ) ) . toBe ( false )
85
- expect ( isIncludedRoute ( b , d ) ) . toBe ( false )
86
- expect ( isIncludedRoute ( c , d ) ) . toBe ( false )
83
+ expect ( isIncludedRoute ( a , c ) ) . toBe ( true )
84
+
85
+ const d = { path : '/users/hello/world' }
86
+ const e = { path : '/users/hello' }
87
+ const f = { path : '/users/hello-world' }
88
+ expect ( isIncludedRoute ( d , e ) ) . toBe ( true )
89
+ expect ( isIncludedRoute ( d , f ) ) . toBe ( false )
87
90
} )
88
91
} )
89
92
} )
You can’t perform that action at this time.
0 commit comments