1
1
import { createTest } from '../create-test'
2
+ import { expectPathname } from '../lib/assertions'
2
3
import { getUrl } from './flush-after-navigate.defs'
3
4
4
5
export const testFlushAfterNavigate = createTest (
@@ -9,7 +10,7 @@ export const testFlushAfterNavigate = createTest(
9
10
cy . contains ( '#hydration-marker' , 'hydrated' ) . should ( 'be.hidden' )
10
11
cy . get ( '#test' ) . click ( )
11
12
cy . get ( 'a' ) . click ( )
12
- cy . location ( 'pathname' ) . should ( 'eq' , path + '/end' )
13
+ expectPathname ( path + '/end' )
13
14
cy . get ( '#client-state' ) . should ( 'have.text' , 'pass' )
14
15
cy . location ( 'search' ) . should ( 'be.empty' )
15
16
cy . location ( 'search' ) . should ( 'eq' , '?test=pass' ) // Then it flushes
@@ -19,7 +20,7 @@ export const testFlushAfterNavigate = createTest(
19
20
cy . contains ( '#hydration-marker' , 'hydrated' ) . should ( 'be.hidden' )
20
21
cy . get ( '#test' ) . click ( )
21
22
cy . get ( 'a' ) . click ( )
22
- cy . location ( 'pathname' ) . should ( 'eq' , path + '/end' )
23
+ expectPathname ( path + '/end' )
23
24
cy . get ( '#client-state' ) . should ( 'have.text' , 'pass' )
24
25
cy . location ( 'search' ) . should ( 'eq' , '?test=nav' )
25
26
cy . location ( 'search' ) . should ( 'eq' , '?test=pass' ) // Then it flushes
@@ -30,7 +31,7 @@ export const testFlushAfterNavigate = createTest(
30
31
cy . get ( '#preflush' ) . click ( ) // Trigger an immediate flush to enable the throttling queue
31
32
cy . get ( '#test' ) . click ( ) // Queue the change
32
33
cy . get ( 'a' ) . click ( ) // Navigate
33
- cy . location ( 'pathname' ) . should ( 'eq' , path + '/end' )
34
+ expectPathname ( path + '/end' )
34
35
cy . get ( '#client-state' ) . should ( 'have.text' , 'pass' )
35
36
cy . location ( 'search' ) . should ( 'be.empty' )
36
37
cy . location ( 'search' ) . should ( 'eq' , '?test=pass' ) // Then it flushes again
@@ -41,7 +42,7 @@ export const testFlushAfterNavigate = createTest(
41
42
cy . get ( '#preflush' ) . click ( ) // Trigger an immediate flush to enable the throttling queue
42
43
cy . get ( '#test' ) . click ( ) // Queue the change
43
44
cy . get ( 'a' ) . click ( ) // Navigate
44
- cy . location ( 'pathname' ) . should ( 'eq' , path + '/end' )
45
+ expectPathname ( path + '/end' )
45
46
cy . get ( '#client-state' ) . should ( 'have.text' , 'pass' )
46
47
cy . location ( 'search' ) . should ( 'eq' , '?test=nav' )
47
48
cy . location ( 'search' ) . should ( 'eq' , '?test=pass' ) // Then it flushes again
0 commit comments