@@ -27,17 +27,13 @@ import { cleanUp } from 'support/util/cleanup';
27
27
* Returns the Cloud Manager URL to clone a given Linode.
28
28
*
29
29
* @param linode - Linode for which to retrieve clone URL.
30
- * @param withRegion - Whether to append a region query to the URL.
31
30
*
32
31
* @returns Cloud Manager Clone URL for Linode.
33
32
*/
34
- const getLinodeCloneUrl = (
35
- linode : Linode ,
36
- withRegion : boolean = true
37
- ) : string => {
38
- const regionQuery = withRegion ? `®ionID=${ linode . region } ` : '' ;
33
+ const getLinodeCloneUrl = ( linode : Linode ) : string => {
34
+ const regionQuery = `®ionID=${ linode . region } ` ;
39
35
const typeQuery = `&typeID=${ linode . type } ` ;
40
- return `/linodes/create?linodeID=${ linode . id } &type=Clone+Linode${ typeQuery } ${ regionQuery } ` ;
36
+ return `/linodes/create?linodeID=${ linode . id } ${ regionQuery } &type=Clone+Linode${ typeQuery } ` ;
41
37
} ;
42
38
43
39
authenticate ( ) ;
@@ -69,6 +65,9 @@ describe('clone linode', () => {
69
65
mockGetFeatureFlagClientstream ( ) . as ( 'getClientStream' ) ;
70
66
71
67
cy . defer ( createLinode ( linodePayload ) ) . then ( ( linode : Linode ) => {
68
+ const linodeRegion = getRegionById ( linodePayload . region ) ;
69
+ const linodeRegionLabel = `${ linodeRegion . label } (${ linodeRegion . id } )` ;
70
+
72
71
interceptCloneLinode ( linode . id ) . as ( 'cloneLinode' ) ;
73
72
cy . visitWithLogin ( `/linodes/${ linode . id } ` ) ;
74
73
@@ -81,10 +80,7 @@ describe('clone linode', () => {
81
80
. click ( ) ;
82
81
83
82
ui . actionMenuItem . findByTitle ( 'Clone' ) . should ( 'be.visible' ) . click ( ) ;
84
-
85
- // Cloning from Linode Details page does not pre-select a region.
86
- // (Cloning from the Linodes landing does pre-select a region, however.)
87
- cy . url ( ) . should ( 'endWith' , getLinodeCloneUrl ( linode , false ) ) ;
83
+ cy . url ( ) . should ( 'endWith' , getLinodeCloneUrl ( linode ) ) ;
88
84
89
85
// Select clone region and Linode type.
90
86
ui . regionSelect . find ( ) . click ( ) ;
0 commit comments