@@ -97,4 +97,36 @@ describe('EditDatasetMenu', () => {
9797 . should ( 'have.class' , 'disabled' )
9898 cy . findByRole ( 'button' , { name : 'Metadata' } ) . should ( 'exist' ) . should ( 'have.class' , 'disabled' )
9999 } )
100+ it ( 'navigates to the correct URL when Files (Upload) is clicked' , ( ) => {
101+ const dataset = DatasetMother . create ( {
102+ permissions : DatasetPermissionsMother . createWithAllAllowed ( ) ,
103+ locks : [ ] ,
104+ hasValidTermsOfAccess : true ,
105+ version : DatasetVersionMother . createReleasedWithLatestVersionIsADraft ( )
106+ } )
107+
108+ cy . mountAuthenticated ( < EditDatasetMenu dataset = { dataset } /> )
109+
110+ cy . findByRole ( 'button' , { name : 'Edit Dataset' } ) . click ( )
111+ cy . findByRole ( 'button' , { name : 'Files (Upload)' } ) . click ( )
112+ // TODO: use vite plugin to mock navigate
113+ // https://github.com/cypress-io/cypress/tree/develop/npm/vite-plugin-cypress-esm
114+ // expect(navigateMock).to.have.been.calledWith('/upload-dataset-files')
115+ } )
116+ it ( 'navigates to the correct URL when Edit Metadata is clicked' , ( ) => {
117+ const dataset = DatasetMother . create ( {
118+ permissions : DatasetPermissionsMother . createWithAllAllowed ( ) ,
119+ locks : [ ] ,
120+ hasValidTermsOfAccess : true ,
121+ version : DatasetVersionMother . createReleasedWithLatestVersionIsADraft ( )
122+ } )
123+
124+ cy . mountAuthenticated ( < EditDatasetMenu dataset = { dataset } /> )
125+
126+ cy . findByRole ( 'button' , { name : 'Edit Dataset' } ) . click ( )
127+ cy . findByRole ( 'button' , { name : 'Metadata' } ) . click ( )
128+ // TODO: use vite plugin to mock navigate
129+ // https://github.com/cypress-io/cypress/tree/develop/npm/vite-plugin-cypress-esm
130+ // expect(navigateMock).to.have.been.calledWith('/upload-dataset-files')
131+ } )
100132} )
0 commit comments