Skip to content

Commit

Permalink
test tab nav for stova event details component
Browse files Browse the repository at this point in the history
  • Loading branch information
bau123 committed Feb 11, 2025
1 parent 685a165 commit 5306e7d
Showing 1 changed file with 37 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,54 @@ describe('StovaEventDetailsPage', () => {
name: 'this is a stova event',
datahubEvent: { id: 'a-datahub-event' },
}
})

it('should render the component with the detail layout', () => {
cy.mountWithProvider(
<StovaEventDetailsPage stovaEvent={stovaEvent} path={'details'} />
)
cy.get('[data-test="tablist"] button').contains('Details').click()
assertBreadcrumbs({
Home: urls.dashboard.index(),
Events: urls.events.index(),
[stovaEvent.name]: null,
Details: null,
})

assertLocalHeader(stovaEvent.name)

cy.get('[data-test="tablist"]')
.should('exist')
.eq(0)
.should('exist')
.children()
.should('have.length', 2)
.first()
.should('have.text', 'Details')
.next()
.should('have.text', 'Attendees')

assertFlashMessage(
'This event has been automatically synced from Stova. Event details and attendees can only be edited in Stova.'
)
cy.get('[data-test="newWindowLink"]').should(
'have.attr',
'href',
'https://eu-admin.eventscloud.com/loggedin/eVent/index.php?eventid=a-stova-event-id'
)
})

it('should render the component with the layout data', () => {
it('should render the component with the attendee layout', () => {
cy.mountWithProvider(
<StovaEventDetailsPage stovaEvent={stovaEvent} path={'attendees'} />
)
cy.get('[data-test="tablist"] button').contains('Attendees').click()

assertBreadcrumbs({
Home: urls.dashboard.index(),
Events: urls.events.index(),
[stovaEvent.name]: null,
Details: null,
Attendees: null,
})

assertLocalHeader(stovaEvent.name)
Expand Down

0 comments on commit 5306e7d

Please sign in to comment.