@@ -8,7 +8,6 @@ import { ui } from 'support/ui';
88import { apiMatcher } from 'support/util/intercepts' ;
99import { linodeFactory } from '@src/factories' ;
1010import { mockGetLinodeDetails } from 'support/intercepts/linodes' ;
11- import { getClick , fbtClick } from 'support/helpers' ;
1211import { getRegionById } from 'support/util/regions' ;
1312import {
1413 dcPricingMockLinodeTypes ,
@@ -44,7 +43,7 @@ describe('Migrate linodes', () => {
4443
4544 ui . button . findByTitle ( 'Enter Migration Queue' ) . should ( 'be.disabled' ) ;
4645 cy . findByText ( `${ initialRegion . label } ` ) . should ( 'be.visible' ) ;
47- getClick ( '[data-qa-checked="false"]' ) ;
46+ cy . get ( '[data-qa-checked="false"]' ) . click ( ) ;
4847 cy . findByText ( `North America: ${ initialRegion . label } ` ) . should ( 'be.visible' ) ;
4948
5049 ui . regionSelect . find ( ) . click ( ) ;
@@ -59,7 +58,12 @@ describe('Migrate linodes', () => {
5958 }
6059 ) . as ( 'migrateReq' ) ;
6160
62- fbtClick ( 'Enter Migration Queue' ) ;
61+ ui . button
62+ . findByTitle ( 'Enter Migration Queue' )
63+ . should ( 'be.visible' )
64+ . should ( 'be.enabled' )
65+ . click ( ) ;
66+
6367 cy . wait ( '@migrateReq' ) . its ( 'response.statusCode' ) . should ( 'eq' , 200 ) ;
6468 } ) ;
6569
@@ -93,7 +97,7 @@ describe('Migrate linodes', () => {
9397
9498 ui . button . findByTitle ( 'Enter Migration Queue' ) . should ( 'be.disabled' ) ;
9599 cy . findByText ( `${ initialRegion . label } ` ) . should ( 'be.visible' ) ;
96- getClick ( '[data-qa-checked="false"]' ) ;
100+ cy . get ( '[data-qa-checked="false"]' ) . click ( ) ;
97101 cy . findByText ( `North America: ${ initialRegion . label } ` ) . should ( 'be.visible' ) ;
98102
99103 ui . regionSelect . find ( ) . click ( ) ;
@@ -130,7 +134,11 @@ describe('Migrate linodes', () => {
130134 // intercept migration request and stub it, respond with 200
131135 mockMigrateLinode ( mockLinode . id ) . as ( 'migrateReq' ) ;
132136
133- fbtClick ( 'Enter Migration Queue' ) ;
137+ ui . button
138+ . findByTitle ( 'Enter Migration Queue' )
139+ . should ( 'be.visible' )
140+ . should ( 'be.enabled' )
141+ . click ( ) ;
134142 cy . wait ( '@migrateReq' ) . its ( 'response.statusCode' ) . should ( 'eq' , 200 ) ;
135143 } ) ;
136144
@@ -164,11 +172,17 @@ describe('Migrate linodes', () => {
164172
165173 ui . button . findByTitle ( 'Enter Migration Queue' ) . should ( 'be.disabled' ) ;
166174 cy . findByText ( `${ initialRegion . label } ` ) . should ( 'be.visible' ) ;
167- getClick ( '[data-qa-checked="false"]' ) ;
175+ cy . get ( '[data-qa-checked="false"]' ) . click ( ) ;
168176
169177 // Confirm that user cannot select the Linode's current DC when migrating.
170- cy . findByText ( 'New Region' ) . click ( ) . type ( `${ initialRegion . label } {enter}` ) ;
171- cy . findByText ( 'No results' ) . should ( 'be.visible' ) ;
178+ // TODO Consider refactoring this flow into its own test.
179+ ui . autocomplete . findByLabel ( 'New Region' ) . click ( ) . type ( initialRegion . id ) ;
180+
181+ ui . autocompletePopper . find ( ) . within ( ( ) => {
182+ cy . contains ( initialRegion . id ) . should ( 'not.exist' ) ;
183+ cy . findByText ( 'No results' ) . should ( 'be.visible' ) ;
184+ } ) ;
185+
172186 // Confirm that DC pricing information does not show up
173187 cy . findByText ( dcPricingCurrentPriceLabel ) . should ( 'not.exist' ) ;
174188 cy . get ( '[data-testid="current-price-panel"]' ) . should ( 'not.exist' ) ;
0 commit comments