Skip to content

Commit

Permalink
upcoming: [M3-8576] – Fix "Create Volume" button state when "Encrypt …
Browse files Browse the repository at this point in the history
…Volume" checkbox is checked (linode#10929)
  • Loading branch information
dwiley-akamai authored and nikhagra-akamai committed Sep 23, 2024
1 parent 754d5ee commit ed76219
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -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))
27 changes: 23 additions & 4 deletions packages/manager/cypress/e2e/core/volumes/create-volume.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
);
});
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand All @@ -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');
}
);
});
Expand Down
5 changes: 3 additions & 2 deletions packages/manager/src/features/Volumes/VolumeCreate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ export const VolumeCreate = () => {

const shouldDisplayClientLibraryCopy =
isBlockStorageEncryptionFeatureEnabled &&
values.linode_id !== null &&
linode_id !== null &&
!linodeSupportsBlockStorageEncryption;

return (
Expand Down Expand Up @@ -502,7 +502,8 @@ export const VolumeCreate = () => {
<Button
disabled={
disabled ||
(isBlockStorageEncryptionFeatureEnabled &&
(isBlockStorageEncryptionFeatureEnabled && // @TODO BSE: Once BSE is fully rolled out, remove feature enabled check/condition
linode_id !== null &&
!linodeSupportsBlockStorageEncryption &&
values.encryption === 'enabled')
}
Expand Down

0 comments on commit ed76219

Please sign in to comment.