diff --git a/tests/component/sections/layout/header/LoggedInHeaderActions.spec.tsx b/tests/component/sections/layout/header/LoggedInHeaderActions.spec.tsx index 26751e0ee..9a172df70 100644 --- a/tests/component/sections/layout/header/LoggedInHeaderActions.spec.tsx +++ b/tests/component/sections/layout/header/LoggedInHeaderActions.spec.tsx @@ -14,7 +14,7 @@ describe('LoggedInHeaderActions', () => { canAddCollection: false }) ) - + collectionRepository.getById = cy.stub().resolves(CollectionMother.create()) cy.customMount( ) diff --git a/tests/component/sections/shared/add-data-actions/AddDataActionsButton.spec.tsx b/tests/component/sections/shared/add-data-actions/AddDataActionsButton.spec.tsx index bdd636346..43407b797 100644 --- a/tests/component/sections/shared/add-data-actions/AddDataActionsButton.spec.tsx +++ b/tests/component/sections/shared/add-data-actions/AddDataActionsButton.spec.tsx @@ -2,7 +2,13 @@ import AddDataActionsButton from '../../../../../src/sections/shared/add-data-ac describe('AddDataActionsButton', () => { it('renders the button', () => { - cy.customMount() + cy.customMount( + + ) cy.findByRole('button', { name: /Add Data/i }).should('exist') cy.findByRole('button', { name: /Add Data/ }).click() @@ -10,15 +16,6 @@ describe('AddDataActionsButton', () => { cy.findByText('New Dataset').should('be.visible') }) - it('renders the new dataset button with the correct generated link', () => { - cy.customMount() - - cy.findByRole('button', { name: /Add Data/i }).click() - cy.findByText('New Dataset') - .should('be.visible') - .should('have.attr', 'href', '/datasets/root/create') - }) - it('renders the new dataset button with the correct generated link for specified collectionId', () => { const collectionId = 'some-collection-id' cy.customMount( @@ -36,7 +33,14 @@ describe('AddDataActionsButton', () => { }) it('shows New Collection button enabled if user has permissions to create collection', () => { - cy.customMount() + const collectionId = 'some-collection-id' + cy.customMount( + + ) cy.findByRole('button', { name: /Add Data/i }).as('addDataBtn') cy.get('@addDataBtn').should('exist') @@ -47,7 +51,14 @@ describe('AddDataActionsButton', () => { }) it('shows New Dataset button enabled if user has permissions to create dataset', () => { - cy.customMount() + const collectionId = 'some-collection-id' + cy.customMount( + + ) cy.findByRole('button', { name: /Add Data/i }).as('addDataBtn') cy.get('@addDataBtn').should('exist') @@ -58,7 +69,14 @@ describe('AddDataActionsButton', () => { }) it('shows New Collection button disabled if user does not have permissions to create collection', () => { - cy.customMount() + const collectionId = 'some-collection-id' + cy.customMount( + + ) cy.findByRole('button', { name: /Add Data/i }).as('addDataBtn') cy.get('@addDataBtn').should('exist') @@ -69,7 +87,14 @@ describe('AddDataActionsButton', () => { }) it('shows New Dataset button disabled if user does not have permissions to create dataset', () => { - cy.customMount() + const collectionId = 'some-collection-id' + cy.customMount( + + ) cy.findByRole('button', { name: /Add Data/i }).as('addDataBtn') cy.get('@addDataBtn').should('exist')