1
1
const runTests = ( ) => {
2
2
it ( `should redirect page to index page when there is no such page` , ( ) => {
3
- cy . visit ( `/redirect-without-page` , {
3
+ cy . visit ( `/redirect-without-page/ ` , {
4
4
failOnStatusCode : false ,
5
5
} ) . waitForRouteChange ( )
6
6
7
7
cy . location ( `pathname` ) . should ( `equal` , `/` )
8
8
} )
9
9
10
10
it ( `should redirect page to index page even there is a such page` , ( ) => {
11
- cy . visit ( `/redirect` , {
11
+ cy . visit ( `/redirect/ ` , {
12
12
failOnStatusCode : false ,
13
13
} ) . waitForRouteChange ( )
14
14
@@ -29,17 +29,17 @@ const runTests = () => {
29
29
} ) . waitForRouteChange ( )
30
30
31
31
cy . getTestElement ( `redirect-two-anchor` ) . click ( ) . waitForRouteChange ( )
32
- cy . location ( `pathname` ) . should ( `equal` , `/redirect-search-hash` )
32
+ cy . location ( `pathname` ) . should ( `equal` , `/redirect-search-hash/ ` )
33
33
cy . location ( `hash` ) . should ( `equal` , `#anchor` )
34
34
cy . location ( `search` ) . should ( `equal` , `` )
35
35
} )
36
36
37
37
it ( `should support hash parameter on direct visit` , ( ) => {
38
- cy . visit ( `/redirect-two#anchor` , {
38
+ cy . visit ( `/redirect-two/ #anchor` , {
39
39
failOnStatusCode : false ,
40
40
} ) . waitForRouteChange ( )
41
41
42
- cy . location ( `pathname` ) . should ( `equal` , `/redirect-search-hash` )
42
+ cy . location ( `pathname` ) . should ( `equal` , `/redirect-search-hash/ ` )
43
43
cy . location ( `hash` ) . should ( `equal` , `#anchor` )
44
44
cy . location ( `search` ) . should ( `equal` , `` )
45
45
} )
@@ -50,17 +50,17 @@ const runTests = () => {
50
50
} ) . waitForRouteChange ( )
51
51
52
52
cy . getTestElement ( `redirect-two-search` ) . click ( ) . waitForRouteChange ( )
53
- cy . location ( `pathname` ) . should ( `equal` , `/redirect-search-hash` )
53
+ cy . location ( `pathname` ) . should ( `equal` , `/redirect-search-hash/ ` )
54
54
cy . location ( `hash` ) . should ( `equal` , `` )
55
55
cy . location ( `search` ) . should ( `equal` , `?query_param=hello` )
56
56
} )
57
57
58
58
it ( `should support search parameter on direct visit` , ( ) => {
59
- cy . visit ( `/redirect-two?query_param=hello` , {
59
+ cy . visit ( `/redirect-two/ ?query_param=hello` , {
60
60
failOnStatusCode : false ,
61
61
} ) . waitForRouteChange ( )
62
62
63
- cy . location ( `pathname` ) . should ( `equal` , `/redirect-search-hash` )
63
+ cy . location ( `pathname` ) . should ( `equal` , `/redirect-search-hash/ ` )
64
64
cy . location ( `hash` ) . should ( `equal` , `` )
65
65
cy . location ( `search` ) . should ( `equal` , `?query_param=hello` )
66
66
} )
@@ -71,17 +71,17 @@ const runTests = () => {
71
71
} ) . waitForRouteChange ( )
72
72
73
73
cy . getTestElement ( `redirect-two-search-anchor` ) . click ( ) . waitForRouteChange ( )
74
- cy . location ( `pathname` ) . should ( `equal` , `/redirect-search-hash` )
74
+ cy . location ( `pathname` ) . should ( `equal` , `/redirect-search-hash/ ` )
75
75
cy . location ( `hash` ) . should ( `equal` , `#anchor` )
76
76
cy . location ( `search` ) . should ( `equal` , `?query_param=hello` )
77
77
} )
78
78
79
79
it ( `should support search & hash parameter on direct visit` , ( ) => {
80
- cy . visit ( `/redirect-two?query_param=hello#anchor` , {
80
+ cy . visit ( `/redirect-two/ ?query_param=hello#anchor` , {
81
81
failOnStatusCode : false ,
82
82
} ) . waitForRouteChange ( )
83
83
84
- cy . location ( `pathname` ) . should ( `equal` , `/redirect-search-hash` )
84
+ cy . location ( `pathname` ) . should ( `equal` , `/redirect-search-hash/ ` )
85
85
cy . location ( `hash` ) . should ( `equal` , `#anchor` )
86
86
cy . location ( `search` ) . should ( `equal` , `?query_param=hello` )
87
87
} )
0 commit comments