@@ -189,93 +189,4 @@ describe('StaticRouter', () => {
189
189
190
190
} )
191
191
} )
192
-
193
- // TODO: maybe these tests just move to Link, Redirect, and NavigationPrompt,
194
- // or like "integration-test.js"
195
- describe . skip ( 'context' , ( ) => {
196
- describe ( 'createHref' , ( ) => {
197
- it ( 'creates hrefs' , ( ) => {
198
- const markup = renderToString (
199
- < StaticRouter location = "/" >
200
- < Link to = "/somewhere" />
201
- </ StaticRouter >
202
- )
203
- expect ( markup ) . toMatch ( / \/ s o m e w h e r e / )
204
- } )
205
-
206
- it ( 'uses createHref prop' , ( ) => {
207
- const markup = renderToString (
208
- < StaticRouter location = "/" createHref = { ( href ) => '#' + href } >
209
- < Link to = "/somewhere" />
210
- </ StaticRouter >
211
- )
212
- expect ( markup ) . toMatch ( / # \/ s o m e w h e r e / )
213
- } )
214
- } )
215
-
216
- describe ( 'push' , ( ) => {
217
- it ( 'calls onPush' , ( done ) => {
218
- const assert = ( location ) => {
219
- expect ( location ) . toExist ( )
220
- expect ( location . pathname ) . toEqual ( '/somewhere' )
221
- done ( )
222
- }
223
- renderToString (
224
- < StaticRouter location = "/" onPush = { assert } >
225
- { ( { location } ) => (
226
- location . pathname === "/" ? (
227
- < Redirect to = "/somewhere" push />
228
- ) : (
229
- < div > test</ div >
230
- )
231
- ) }
232
- </ StaticRouter >
233
- )
234
- } )
235
- } )
236
-
237
- describe ( 'replace' , ( ) => {
238
-
239
- it ( 'calls onReplace' , ( done ) => {
240
- const assert = ( location ) => {
241
- expect ( location ) . toExist ( )
242
- expect ( location . pathname ) . toEqual ( '/somewhere' )
243
- done ( )
244
- }
245
- renderToString (
246
- < StaticRouter location = "/" onPush = { assert } >
247
- { ( { location } ) => (
248
- location . pathname === "/" ? (
249
- < Redirect to = "/somewhere" push = { false } />
250
- ) : (
251
- < div > test</ div >
252
- )
253
- ) }
254
- </ StaticRouter >
255
- )
256
- } )
257
- } )
258
-
259
- describe ( 'block' , ( ) => {
260
- it ( 'calls onBlock' , ( done ) => {
261
- const assert = ( location ) => {
262
- expect ( location ) . toExist ( )
263
- expect ( location . pathname ) . toEqual ( '/somewhere' )
264
- done ( )
265
- }
266
- renderToString (
267
- < StaticRouter location = "/" onPush = { assert } >
268
- { ( { location } ) => (
269
- location . pathname === "/" ? (
270
- < Redirect to = "/somewhere" replace />
271
- ) : (
272
- < div > test</ div >
273
- )
274
- ) }
275
- </ StaticRouter >
276
- )
277
- } )
278
- } )
279
- } )
280
-
281
192
} )
0 commit comments