@@ -14,12 +14,13 @@ describe("Deep linking feature", () => {
1414
1515 describe ( "Operation with whitespace in tag+id" , ( ) => {
1616 const elementToGet = ".opblock-post"
17+ const correctFragment = "#/my%20Tag/my%20Operation"
1718
1819 BaseDeeplinkTestFactory ( {
1920 baseUrl : swagger2BaseUrl ,
2021 elementToGet,
2122 correctElementId : "operations-my_Tag-my_Operation" ,
22- correctFragment : "#/my%20Tag/my%20Operation" ,
23+ correctFragment,
2324 correctHref : "#/my%20Tag/my%20Operation"
2425 } )
2526
@@ -31,6 +32,13 @@ describe("Deep linking feature", () => {
3132 . get ( `${ elementToGet } .is-open` )
3233 . should ( "exist" )
3334 } )
35+
36+ it . skip ( "should rewrite to the correct fragment when provided the legacy fragment" , ( ) => {
37+ cy . visit ( `${ swagger2BaseUrl } ${ legacyFragment } ` )
38+ . reload ( )
39+ . window ( )
40+ . should ( "have.deep.property" , "location.hash" , correctFragment )
41+ } )
3442 } )
3543
3644 describe ( "Operation with underscores in tag+id" , ( ) => {
@@ -91,14 +99,13 @@ describe("Deep linking feature", () => {
9199
92100 describe ( "Operation with whitespace in tag+id" , ( ) => {
93101 const elementToGet = ".opblock-post"
94- const correctElementId = "operations-my_Tag-my_Operation"
95102 const correctFragment = "#/my%20Tag/my%20Operation"
96103
97104 BaseDeeplinkTestFactory ( {
98105 baseUrl : openAPI3BaseUrl ,
99106 elementToGet : ".opblock-post" ,
100107 correctElementId : "operations-my_Tag-my_Operation" ,
101- correctFragment : "#/my%20Tag/my%20Operation" ,
108+ correctFragment,
102109 correctHref : "#/my%20Tag/my%20Operation"
103110 } )
104111
@@ -110,6 +117,14 @@ describe("Deep linking feature", () => {
110117 . get ( `${ elementToGet } .is-open` )
111118 . should ( "exist" )
112119 } )
120+
121+
122+ it . skip ( "should rewrite to the correct fragment when provided the legacy fragment" , ( ) => {
123+ cy . visit ( `${ openAPI3BaseUrl } ${ legacyFragment } ` )
124+ . reload ( )
125+ . window ( )
126+ . should ( "have.deep.property" , "location.hash" , correctFragment )
127+ } )
113128 } )
114129
115130 describe ( "Operation with underscores in tag+id" , ( ) => {
@@ -187,4 +202,12 @@ function BaseDeeplinkTestFactory({ baseUrl, elementToGet, correctElementId, corr
187202 . get ( `${ elementToGet } .is-open` )
188203 . should ( "exist" )
189204 } )
205+
206+ it ( "should retain the correct fragment when reloaded" , ( ) => {
207+ cy . visit ( `${ baseUrl } ${ correctFragment } ` )
208+ . reload ( )
209+ . should ( "exist" )
210+ . window ( )
211+ . should ( "have.deep.property" , "location.hash" , correctFragment )
212+ } )
190213}
0 commit comments