From edf9290aa509925d5f728435062d49ba8e15855a Mon Sep 17 00:00:00 2001 From: Jeff Puzzo Date: Wed, 13 Nov 2024 14:12:32 -0500 Subject: [PATCH] Fix workbench test --- .../tests/mocked/projects/workbench.cy.ts | 24 ------------------- .../projects/screens/spawner/SpawnerPage.tsx | 2 +- .../screens/spawner/storage/constants.ts | 1 - 3 files changed, 1 insertion(+), 26 deletions(-) diff --git a/frontend/src/__tests__/cypress/cypress/tests/mocked/projects/workbench.cy.ts b/frontend/src/__tests__/cypress/cypress/tests/mocked/projects/workbench.cy.ts index 1e3a6bd7be..fa92fcba22 100644 --- a/frontend/src/__tests__/cypress/cypress/tests/mocked/projects/workbench.cy.ts +++ b/frontend/src/__tests__/cypress/cypress/tests/mocked/projects/workbench.cy.ts @@ -686,35 +686,11 @@ describe('Workbench page', () => { editSpawnerPage.findAcceleratorProfileSelect().findSelectOption('None').click(); editSpawnerPage.findAcceleratorProfileSelect().should('contain', 'None'); - cy.interceptK8s('PUT', PVCModel, mockPVCK8sResource({ name: 'test-notebook' })).as( - 'editClusterStorage', - ); cy.interceptK8s('PUT', NotebookModel, mockNotebookK8sResource({})).as('editWorkbenchDryRun'); cy.interceptK8s('PATCH', NotebookModel, mockNotebookK8sResource({})).as('editWorkbench'); editSpawnerPage.findSubmitButton().click(); - cy.wait('@editClusterStorage').then((interception) => { - expect(interception.request.url).to.include('?dryRun=All'); - expect(interception.request.body).to.containSubset({ - metadata: { - annotations: { - 'openshift.io/description': '', - 'openshift.io/display-name': 'Test Storage', - }, - name: 'test-notebook', - namespace: 'test-project', - labels: { - 'opendatahub.io/dashboard': 'true', - }, - }, - spec: { - resources: { requests: { storage: '5Gi' } }, - }, - status: { phase: 'Pending', accessModes: ['ReadWriteOnce'], capacity: { storage: '5Gi' } }, - }); - }); - cy.wait('@editWorkbenchDryRun').then((interception) => { expect(interception.request.url).to.include('?dryRun=All'); expect(interception.request.body).to.containSubset({ diff --git a/frontend/src/pages/projects/screens/spawner/SpawnerPage.tsx b/frontend/src/pages/projects/screens/spawner/SpawnerPage.tsx index b4b41dd940..da5e3e71a8 100644 --- a/frontend/src/pages/projects/screens/spawner/SpawnerPage.tsx +++ b/frontend/src/pages/projects/screens/spawner/SpawnerPage.tsx @@ -115,7 +115,7 @@ const SpawnerPage: React.FC = ({ existingNotebook }) => { name: k8sNameDescriptionData.data.name || defaultClusterStorage.name, description: defaultClusterStorage.description, size: defaultClusterStorage.size || defaultNotebookSize, - storageClassName: defaultStorageClassName || defaultClusterStorage.storageClassName, + storageClassName: defaultStorageClassName, mountPath: defaultClusterStorage.mountPath, }, ], diff --git a/frontend/src/pages/projects/screens/spawner/storage/constants.ts b/frontend/src/pages/projects/screens/spawner/storage/constants.ts index 49f208d05e..a7ce7d9aad 100644 --- a/frontend/src/pages/projects/screens/spawner/storage/constants.ts +++ b/frontend/src/pages/projects/screens/spawner/storage/constants.ts @@ -32,5 +32,4 @@ export const defaultClusterStorage = { description: '', size: '20Gi', mountPath: MOUNT_PATH_PREFIX, - storageClassName: '', };