diff --git a/frontend/src/__tests__/cypress/cypress/pages/clusterStorage.ts b/frontend/src/__tests__/cypress/cypress/pages/clusterStorage.ts index 56dfad7271..e218cdde6a 100644 --- a/frontend/src/__tests__/cypress/cypress/pages/clusterStorage.ts +++ b/frontend/src/__tests__/cypress/cypress/pages/clusterStorage.ts @@ -48,6 +48,19 @@ class ClusterStorageRow extends TableRow { findStorageClassResourceKindText() { return cy.findByTestId('resource-kind-text'); } + + findStorageSizeWarning() { + return cy.findByTestId('size-warning-popover').click(); + } + + findStorageSizeWarningText() { + return cy + .findByTestId('size-warning-popover-text') + .should( + 'have.text', + 'To complete the storage size update, you must connect and run a workbench.', + ); + } } class ClusterStorageModal extends Modal { diff --git a/frontend/src/__tests__/cypress/cypress/tests/mocked/projects/clusterStorage.cy.ts b/frontend/src/__tests__/cypress/cypress/tests/mocked/projects/clusterStorage.cy.ts index a572757d9c..3ca4c6c0c4 100644 --- a/frontend/src/__tests__/cypress/cypress/tests/mocked/projects/clusterStorage.cy.ts +++ b/frontend/src/__tests__/cypress/cypress/tests/mocked/projects/clusterStorage.cy.ts @@ -56,6 +56,28 @@ const initInterceptors = ({ isEmpty = false, storageClassName }: HandlersProps) storageClassName, status: { phase: 'Pending' }, }), + mockPVCK8sResource({ + displayName: 'Updated storage with no workbench', + storageClassName, + storage: '13Gi', + status: { + phase: 'Bound', + accessModes: ['ReadWriteOnce'], + capacity: { + storage: '12Gi', + }, + conditions: [ + { + type: 'FileSystemResizePending', + status: 'True', + lastProbeTime: null, + lastTransitionTime: '2024-11-15T14:04:04Z', + message: + 'Waiting for user to (re-)start a pod to finish file system resize of volume on node.', + }, + ], + }, + }), ], ), ); @@ -322,6 +344,18 @@ describe('ClusterStorage', () => { clusterStorage.findClusterStorageTableHeaderButton('Name').should(be.sortDescending); }); + it('should show warning when cluster storage size is updated but no workbench is connected', () => { + initInterceptors({}); + clusterStorage.visit('test-project'); + const clusterStorageRow = clusterStorage.getClusterStorageRow( + 'Updated storage with no workbench', + ); + clusterStorageRow.toggleExpandableContent(); + clusterStorageRow.shouldHaveStorageSize('Max 13Gi'); + clusterStorageRow.findStorageSizeWarning(); + clusterStorageRow.findStorageSizeWarning().should('exist'); + }); + it('Edit cluster storage', () => { initInterceptors({}); clusterStorage.visit('test-project'); diff --git a/frontend/src/concepts/dashboard/DashboardPopupIconButton.tsx b/frontend/src/concepts/dashboard/DashboardPopupIconButton.tsx index 2984a3e08a..eb5b0db48e 100644 --- a/frontend/src/concepts/dashboard/DashboardPopupIconButton.tsx +++ b/frontend/src/concepts/dashboard/DashboardPopupIconButton.tsx @@ -1,8 +1,9 @@ import React from 'react'; -import { Button, ButtonProps, Icon } from '@patternfly/react-core'; +import { Button, ButtonProps, Icon, IconComponentProps } from '@patternfly/react-core'; type DashboardPopupIconButtonProps = Omit & { icon: React.ReactNode; + iconProps?: Omit; }; /** @@ -10,9 +11,19 @@ type DashboardPopupIconButtonProps = Omit & */ const DashboardPopupIconButton = ({ icon, + iconProps, ...props }: DashboardPopupIconButtonProps): React.JSX.Element => ( -