@@ -97,42 +97,42 @@ describe('Switcher', function() {
97
97
} ) ;
98
98
99
99
it ( 'gets component with matching path' , function ( ) {
100
- var swtch = this . switcher . getSwitch ( '/another' ) ;
100
+ var swtch = this . switcher . getSwitch ( '/another' , this . switcher . props ) ;
101
101
assert . equal ( swtch . props . children , 'Another' ) ;
102
102
} ) ;
103
103
104
104
it ( 'handles trailing /' , function ( ) {
105
- var swtch = this . switcher . getSwitch ( '/another/' ) ;
105
+ var swtch = this . switcher . getSwitch ( '/another/' , this . switcher . props ) ;
106
106
assert . equal ( swtch . props . children , 'Another' ) ;
107
107
} ) ;
108
108
109
109
it ( 'returns null if there is no matching switch' , function ( ) {
110
- var swtch = this . switcher . getSwitch ( '/notHere' ) ;
110
+ var swtch = this . switcher . getSwitch ( '/notHere' , this . switcher . props ) ;
111
111
assert . isNull ( swtch ) ;
112
112
} ) ;
113
113
114
114
it ( 'gets first match if duplicate paths' , function ( ) {
115
- var swtch = this . switcher . getSwitch ( '/duplicate' ) ;
115
+ var swtch = this . switcher . getSwitch ( '/duplicate' , this . switcher . props ) ;
116
116
assert . equal ( swtch . props . children , 'Dup 1' ) ;
117
117
} ) ;
118
118
119
119
it ( 'handles paths with wild cards' , function ( ) {
120
- var swtch = this . switcher . getSwitch ( '/wildCardPath/something' ) ;
121
- var swtch2 = this . switcher . getSwitch ( '/wildCardPath/something/more' ) ;
120
+ var swtch = this . switcher . getSwitch ( '/wildCardPath/something' , this . switcher . props ) ;
121
+ var swtch2 = this . switcher . getSwitch ( '/wildCardPath/something/more' , this . switcher . props ) ;
122
122
assert . equal ( swtch . props . children , 'Wild' ) ;
123
123
assert . equal ( swtch2 . props . children , 'Wild' ) ;
124
124
} ) ;
125
125
126
126
it ( 'handles paths with dynamic segments' , function ( ) {
127
- var swtch = this . switcher . getSwitch ( '/path/abc123/more' ) ;
128
- var swtch2 = this . switcher . getSwitch ( '/path/somethingelse/more' ) ;
127
+ var swtch = this . switcher . getSwitch ( '/path/abc123/more' , this . switcher . props ) ;
128
+ var swtch2 = this . switcher . getSwitch ( '/path/somethingelse/more' , this . switcher . props ) ;
129
129
assert . equal ( swtch . props . children , 'Dynamic' ) ;
130
130
assert . equal ( swtch2 . props . children , 'Dynamic' ) ;
131
131
} ) ;
132
132
133
133
it ( 'handles array of paths' , function ( ) {
134
- var swtch = this . switcher . getSwitch ( '/arr1' ) ;
135
- var swtch2 = this . switcher . getSwitch ( '/arr2/more' ) ;
134
+ var swtch = this . switcher . getSwitch ( '/arr1' , this . switcher . props ) ;
135
+ var swtch2 = this . switcher . getSwitch ( '/arr2/more' , this . switcher . props ) ;
136
136
assert . equal ( swtch . props . children , 'Array' ) ;
137
137
assert . equal ( swtch2 . props . children , 'Array' ) ;
138
138
} ) ;
@@ -156,7 +156,7 @@ describe('Switcher', function() {
156
156
} ) ;
157
157
158
158
it ( 'gets component with matching path' , function ( ) {
159
- var swtch = this . switcher . getSwitch ( '/base/another' ) ;
159
+ var swtch = this . switcher . getSwitch ( '/base/another' , this . switcher . props ) ;
160
160
assert . equal ( swtch . props . children , 'Another' ) ;
161
161
} ) ;
162
162
} ) ;
0 commit comments