Skip to content

Commit

Permalink
Fix workbench test
Browse files Browse the repository at this point in the history
  • Loading branch information
jpuzz0 committed Nov 13, 2024
1 parent 9c3909c commit edf9290
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const SpawnerPage: React.FC<SpawnerPageProps> = ({ existingNotebook }) => {
name: k8sNameDescriptionData.data.name || defaultClusterStorage.name,
description: defaultClusterStorage.description,
size: defaultClusterStorage.size || defaultNotebookSize,
storageClassName: defaultStorageClassName || defaultClusterStorage.storageClassName,
storageClassName: defaultStorageClassName,
mountPath: defaultClusterStorage.mountPath,
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,4 @@ export const defaultClusterStorage = {
description: '',
size: '20Gi',
mountPath: MOUNT_PATH_PREFIX,
storageClassName: '',
};

0 comments on commit edf9290

Please sign in to comment.