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

change: [M3-8075] - "Create Volume" button text changed to "Add Volume". #10808

Merged
merged 3 commits into from
Aug 28, 2024
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Changed
---

"Create Volume" button text to "Add Volume" ([#10808](https://github.com/linode/manager/pull/10808))
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ describe('volumes', () => {
// Create a new volume.
cy.findByText('Storage').should('be.visible').click();

ui.button.findByTitle('Create Volume').should('be.visible').click();
ui.button.findByTitle('Add Volume').should('be.visible').click();

mockGetLinodeVolumes(mockLinode.id, [newVolume]).as('getVolumes');
ui.drawer
Expand Down Expand Up @@ -284,9 +284,9 @@ describe('volumes', () => {
cy.findByText(mockLinode.label).should('be.visible').click();
cy.wait(['@getVolumes', '@getLinodeDetail']);

// Open the Create Volume drawer.
// Open the Add Volume drawer.
cy.findByText('Storage').should('be.visible').click();
ui.button.findByTitle('Create Volume').should('be.visible').click();
ui.button.findByTitle('Add Volume').should('be.visible').click();
cy.wait(['@getVolumeTypesError']);

mockGetLinodeVolumes(mockLinode.id, [newVolume]).as('getVolumes');
Expand Down
49 changes: 26 additions & 23 deletions packages/manager/cypress/e2e/core/volumes/create-volume.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { createTestLinode } from 'support/util/linodes';
import { createLinodeRequestFactory } from 'src/factories/linodes';
import { authenticate } from 'support/api/authentication';
import { cleanUp } from 'support/util/cleanup';
import { containsClick, fbtVisible, fbtClick, getClick } from 'support/helpers';
import { interceptCreateVolume } from 'support/intercepts/volumes';
import { randomNumber, randomString, randomLabel } from 'support/util/random';
import { chooseRegion } from 'support/util/regions';
Expand Down Expand Up @@ -44,16 +43,16 @@ describe('volume create flow', () => {
});

// Fill out and submit volume create form.
containsClick('Label').type(volume.label);
containsClick('Size').type(`{selectall}{backspace}${volume.size}`);
cy.contains('Label').click().type(volume.label);
cy.contains('Size').click().type(`{selectall}{backspace}${volume.size}`);
ui.regionSelect.find().click().type(`${volume.region}{enter}`);

fbtClick('Create Volume');
cy.findByText('Create Volume').click();
cy.wait('@createVolume');

// Validate volume configuration drawer opens, then close it.
fbtVisible('Volume scheduled for creation.');
getClick('[data-qa-close-drawer="true"]');
cy.findByText('Volume scheduled for creation.').should('be.visible');
cy.get('[data-qa-close-drawer="true"]').click();

// Confirm that volume is listed on landing page with expected configuration.
cy.findByText(volume.label)
Expand Down Expand Up @@ -97,8 +96,10 @@ describe('volume create flow', () => {
});

// Fill out and submit volume create form.
containsClick('Label').type(volume.label);
containsClick('Size').type(`{selectall}{backspace}${volume.size}`);
cy.contains('Label').click().type(volume.label);
cy.contains('Size')
.click()
.type(`{selectall}{backspace}${volume.size}`);
ui.regionSelect.find().click().type(`${volume.region}{enter}`);

cy.findByLabelText('Linode')
Expand All @@ -111,12 +112,12 @@ describe('volume create flow', () => {
.should('be.visible')
.click();

fbtClick('Create Volume');
cy.findByText('Create Volume').click();
cy.wait('@createVolume');

// Confirm volume configuration drawer opens, then close it.
fbtVisible('Volume scheduled for creation.');
getClick('[data-qa-close-drawer="true"]');
cy.findByText('Volume scheduled for creation.').should('be.visible');
cy.get('[data-qa-close-drawer="true"]').click();

// Confirm that volume is listed on landing page with expected configuration.
cy.findByText(volume.label)
Expand All @@ -133,8 +134,8 @@ describe('volume create flow', () => {
cy.findByText(volume.label)
.closest('tr')
.within(() => {
fbtVisible(volume.label);
fbtVisible(`${volume.size} GB`);
cy.findByText(volume.label).should('be.visible');
cy.findByText(`${volume.size} GB`).should('be.visible');
});
}
);
Expand Down Expand Up @@ -164,27 +165,29 @@ describe('volume create flow', () => {
localStorageOverrides: pageSizeOverride,
});

// Click "Create Volume" button, fill out and submit volume create drawer form.
fbtClick('Create Volume');
// Click "Add Volume" button, fill out and submit volume create drawer form.
cy.findByText('Add Volume').click();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dchyrva The reason for the failure was the same as create-volume.smoke.spec.ts, just happening in another test. This line was the fix. All tests related to this PR are passing locally now, so this should be set to merge.

The rest of the changes in the file are 1:1 swaps of some deprecated Cypress functions for newer ones.

cy.get('[data-qa-drawer="true"]').within(() => {
fbtVisible(`Create Volume for ${linode.label}`);
containsClick('Create and Attach Volume');
containsClick('Label').type(volume.label);
containsClick('Size').type(`{selectall}{backspace}${volume.size}`);
fbtClick('Create Volume');
cy.findByText(`Create Volume for ${linode.label}`).should(
'be.visible'
);
cy.contains('Create and Attach Volume').click();
cy.contains('Label').click().type(volume.label);
cy.contains('Size').type(`{selectall}{backspace}${volume.size}`);
cy.findByText('Create Volume').click();
});

// Confirm volume configuration drawer opens, then close it.
cy.get('[data-qa-drawer="true"]').within(() => {
getClick('[data-qa-close-drawer="true"]');
cy.get('[data-qa-close-drawer="true"]').click();
});

// Confirm that volume is listed on Linode 'Storage' details page.
cy.findByText(volume.label)
.closest('tr')
.within(() => {
fbtVisible(volume.label);
fbtVisible(`${volume.size} GB`);
cy.findByText(volume.label).should('be.visible');
cy.findByText(`${volume.size} GB`).should('be.visible');
});

// Confirm that volume is listed on landing page with expected configuration.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ export const LinodeVolumes = () => {
disabled={isLinodesGrantReadOnly}
onClick={handleCreateVolume}
>
Create Volume
Add Volume
</Button>
</Paper>
<Table>
Expand Down
Loading