diff --git a/packages/manager/.changeset/pr-10929-upcoming-features-1726156754302.md b/packages/manager/.changeset/pr-10929-upcoming-features-1726156754302.md new file mode 100644 index 00000000000..70e24c98b29 --- /dev/null +++ b/packages/manager/.changeset/pr-10929-upcoming-features-1726156754302.md @@ -0,0 +1,5 @@ +--- +"@linode/manager": Upcoming Features +--- + +Fix 'Create Volume' button state on Volume Create page when 'Encrypt Volume' checkbox is checked ([#10929](https://github.com/linode/manager/pull/10929)) diff --git a/packages/manager/cypress/e2e/core/volumes/create-volume.spec.ts b/packages/manager/cypress/e2e/core/volumes/create-volume.spec.ts index eea86e8d44e..ceac6fc7cf1 100644 --- a/packages/manager/cypress/e2e/core/volumes/create-volume.spec.ts +++ b/packages/manager/cypress/e2e/core/volumes/create-volume.spec.ts @@ -220,8 +220,12 @@ describe('volume create flow', () => { cy.get('[data-qa-checked]').should('be.visible').click(); // }); - // Ensure warning notice is displayed + // Ensure warning notice is displayed and "Create Volume" button is disabled cy.findByText(CLIENT_LIBRARY_UPDATE_COPY).should('be.visible'); + ui.button + .findByTitle('Create Volume') + .should('be.visible') + .should('be.disabled'); } ); }); @@ -274,15 +278,19 @@ describe('volume create flow', () => { cy.get('[data-qa-checked]').should('be.visible').click(); // }); - // Ensure warning notice is not displayed + // Ensure warning notice is not displayed and "Create Volume" button is enabled cy.findByText(CLIENT_LIBRARY_UPDATE_COPY).should('not.exist'); + ui.button + .findByTitle('Create Volume') + .should('be.visible') + .should('be.enabled'); }); /* * - Checks for Block Storage Encryption client library update notice in the Create/Attach Volume drawer from the 'Storage' details page of an existing Linode. */ - it('displays a warning notice re: rebooting for client library updates under the appropriate conditions', () => { + it('displays a warning notice re: rebooting for client library updates under the appropriate conditions in Create/Attach Volume drawer', () => { // Conditions: Block Storage encryption feature flag is on; user has Block Storage Encryption capability; Linode does not support Block Storage Encryption and the user is trying to attach an encrypted volume // Mock feature flag -- @TODO BSE: Remove feature flag once BSE is fully rolled out @@ -321,18 +329,25 @@ describe('volume create flow', () => { // Click "Add Volume" button cy.findByText('Add Volume').click(); + // Check "Encrypt Volume" checkbox cy.get('[data-qa-drawer="true"]').within(() => { cy.get('[data-qa-checked]').should('be.visible').click(); }); + // Ensure client library update notice is displayed and the "Create Volume" button is disabled cy.findByText(CLIENT_LIBRARY_UPDATE_COPY).should('be.visible'); + ui.button.findByTitle('Create Volume').should('be.disabled'); // Ensure notice is cleared when switching views in drawer cy.get('[data-qa-radio="Attach Existing Volume"]').click(); cy.wait(['@getVolumes']); cy.findByText(CLIENT_LIBRARY_UPDATE_COPY).should('not.exist'); + ui.button + .findByTitle('Attach Volume') + .should('be.visible') + .should('be.enabled'); - // Ensure notice is displayed in "Attach Existing Volume" view when an encrypted volume is selected + // Ensure notice is displayed in "Attach Existing Volume" view when an encrypted volume is selected, & that the "Attach Volume" button is disabled cy.findByPlaceholderText('Select a Volume') .should('be.visible') .click() @@ -343,6 +358,10 @@ describe('volume create flow', () => { .click(); cy.findByText(CLIENT_LIBRARY_UPDATE_COPY).should('be.visible'); + ui.button + .findByTitle('Attach Volume') + .should('be.visible') + .should('be.disabled'); } ); }); diff --git a/packages/manager/src/features/Volumes/VolumeCreate.tsx b/packages/manager/src/features/Volumes/VolumeCreate.tsx index aadec8974d9..a9c9ec96df3 100644 --- a/packages/manager/src/features/Volumes/VolumeCreate.tsx +++ b/packages/manager/src/features/Volumes/VolumeCreate.tsx @@ -297,7 +297,7 @@ export const VolumeCreate = () => { const shouldDisplayClientLibraryCopy = isBlockStorageEncryptionFeatureEnabled && - values.linode_id !== null && + linode_id !== null && !linodeSupportsBlockStorageEncryption; return ( @@ -502,7 +502,8 @@ export const VolumeCreate = () => {