22 createLinodeRequestFactory ,
33 linodeConfigInterfaceFactory ,
44 linodeFactory ,
5+ regionFactory ,
56} from '@linode/utilities' ;
67import {
78 VLANFactory ,
@@ -31,6 +32,7 @@ import {
3132 mockGetLinodeVolumes ,
3233 mockGetLinodes ,
3334} from 'support/intercepts/linodes' ;
35+ import { mockGetRegions } from 'support/intercepts/regions' ;
3436import { mockGetVLANs } from 'support/intercepts/vlans' ;
3537import { ui } from 'support/ui' ;
3638import { linodeCreatePage } from 'support/ui/pages' ;
@@ -42,7 +44,7 @@ import {
4244 randomNumber ,
4345 randomString ,
4446} from 'support/util/random' ;
45- import { chooseRegion , getRegionById } from 'support/util/regions' ;
47+ import { chooseRegion , extendRegion } from 'support/util/regions' ;
4648
4749import type { Linode } from '@linode/api-v4' ;
4850
@@ -306,9 +308,27 @@ describe('clone linode', () => {
306308 * - Confirms that notice is shown when selecting a region with a different price structure.
307309 */
308310 it ( 'shows DC-specific pricing information during clone flow' , ( ) => {
309- const initialRegion = getRegionById ( 'us-west' ) ;
310- const newRegion = getRegionById ( 'us-east' ) ;
311-
311+ const mockRegions = [
312+ extendRegion (
313+ regionFactory . build ( {
314+ capabilities : [ 'Linodes' ] ,
315+ country : 'us' ,
316+ id : 'us-west' ,
317+ label : 'Fremont, CA' ,
318+ } )
319+ ) ,
320+ extendRegion (
321+ regionFactory . build ( {
322+ capabilities : [ 'Linodes' ] ,
323+ country : 'us' ,
324+ id : 'us-east' ,
325+ label : 'Newark, NJ' ,
326+ } )
327+ ) ,
328+ ] ;
329+ mockGetRegions ( mockRegions ) . as ( 'getRegions' ) ;
330+ const initialRegion = mockRegions [ 0 ] ;
331+ const newRegion = mockRegions [ 1 ] ;
312332 const mockLinode = linodeFactory . build ( {
313333 region : initialRegion . id ,
314334 type : dcPricingMockLinodeTypes [ 0 ] . id ,
@@ -323,7 +343,7 @@ describe('clone linode', () => {
323343 mockGetLinodeTypes ( dcPricingMockLinodeTypes ) . as ( 'getLinodeTypes' ) ;
324344
325345 cy . visitWithLogin ( getLinodeCloneUrl ( mockLinode ) ) ;
326- cy . wait ( [ '@getLinode' , '@getLinodes' , '@getLinodeTypes' ] ) ;
346+ cy . wait ( [ '@getRegions' , '@ getLinode', '@getLinodes' , '@getLinodeTypes' ] ) ;
327347
328348 // Confirm there is a docs link to the pricing page.
329349 cy . findByText ( dcPricingDocsLabel )
0 commit comments