Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: [M3-8919] - Fix Linode migration test failure caused by region label conflict #11274

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-11274-tests-1731956375334.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Tests
---

Fix Linode migration test failure caused by region label conflicts ([#11274](https://github.com/linode/manager/pull/11274))
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { ui } from 'support/ui';
import { apiMatcher } from 'support/util/intercepts';
import { linodeFactory } from '@src/factories';
import { mockGetLinodeDetails } from 'support/intercepts/linodes';
import { getClick, fbtClick } from 'support/helpers';
import { getRegionById } from 'support/util/regions';
import {
dcPricingMockLinodeTypes,
Expand Down Expand Up @@ -44,7 +43,7 @@ describe('Migrate linodes', () => {

ui.button.findByTitle('Enter Migration Queue').should('be.disabled');
cy.findByText(`${initialRegion.label}`).should('be.visible');
getClick('[data-qa-checked="false"]');
cy.get('[data-qa-checked="false"]').click();
cy.findByText(`North America: ${initialRegion.label}`).should('be.visible');

ui.regionSelect.find().click();
Expand All @@ -59,7 +58,12 @@ describe('Migrate linodes', () => {
}
).as('migrateReq');

fbtClick('Enter Migration Queue');
ui.button
.findByTitle('Enter Migration Queue')
.should('be.visible')
.should('be.enabled')
.click();

cy.wait('@migrateReq').its('response.statusCode').should('eq', 200);
});

Expand Down Expand Up @@ -93,7 +97,7 @@ describe('Migrate linodes', () => {

ui.button.findByTitle('Enter Migration Queue').should('be.disabled');
cy.findByText(`${initialRegion.label}`).should('be.visible');
getClick('[data-qa-checked="false"]');
cy.get('[data-qa-checked="false"]').click();
cy.findByText(`North America: ${initialRegion.label}`).should('be.visible');

ui.regionSelect.find().click();
Expand Down Expand Up @@ -130,7 +134,11 @@ describe('Migrate linodes', () => {
// intercept migration request and stub it, respond with 200
mockMigrateLinode(mockLinode.id).as('migrateReq');

fbtClick('Enter Migration Queue');
ui.button
.findByTitle('Enter Migration Queue')
.should('be.visible')
.should('be.enabled')
.click();
cy.wait('@migrateReq').its('response.statusCode').should('eq', 200);
});

Expand Down Expand Up @@ -164,11 +172,17 @@ describe('Migrate linodes', () => {

ui.button.findByTitle('Enter Migration Queue').should('be.disabled');
cy.findByText(`${initialRegion.label}`).should('be.visible');
getClick('[data-qa-checked="false"]');
cy.get('[data-qa-checked="false"]').click();

// Confirm that user cannot select the Linode's current DC when migrating.
cy.findByText('New Region').click().type(`${initialRegion.label}{enter}`);
cy.findByText('No results').should('be.visible');
// TODO Consider refactoring this flow into its own test.
ui.autocomplete.findByLabel('New Region').click().type(initialRegion.id);

ui.autocompletePopper.find().within(() => {
cy.contains(initialRegion.id).should('not.exist');
cy.findByText('No results').should('be.visible');
});

// Confirm that DC pricing information does not show up
cy.findByText(dcPricingCurrentPriceLabel).should('not.exist');
cy.get('[data-testid="current-price-panel"]').should('not.exist');
Expand Down