Skip to content

Commit

Permalink
test: update component and e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
ekraffmiller committed Sep 23, 2024
1 parent eeb3a8a commit 080b4f2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe('PublishCollectionModal', () => {
// Check if the modal is rendered
cy.findByText('Publish Collection').should('exist')
cy.contains('Are you sure you want to publish your collection?').should('exist')
cy.findByText('Continue').click()
cy.findByRole('button', { name: 'Continue' }).click()
cy.get('@repositoryPublish').should('have.been.calledWith', 'testCollectionId')
})
})
16 changes: 16 additions & 0 deletions tests/e2e-integration/e2e/sections/collection/Collection.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,23 @@ describe('Collection Page', () => {
cy.findAllByText(title).should('be.visible')
})
})
it('Successfully publishes a collection', () => {
const timestamp = new Date().valueOf()
const uniqueCollectionId = `test-publish-collection-${timestamp}`
cy.wrap(CollectionHelper.create(uniqueCollectionId))
.its('id')
.then((collectionId: string) => {
console.log('collectionId', collectionId)
cy.visit(`/spa/collections/${collectionId}`)
cy.findByText('Unpublished').should('exist')
cy.findByRole('button', { name: 'Publish' }).click()

cy.findByText(/Publish Collection/i).should('exist')
cy.findByRole('button', { name: 'Continue' }).click()
cy.contains('Your collection is now public.').should('exist')
cy.findByText('Unpublished').should('not.exist')
})
})
it('Navigates to Create Dataset page when New Dataset link clicked', () => {
cy.visit('/spa/collections')

Expand Down

0 comments on commit 080b4f2

Please sign in to comment.