cover reschedule failure states
This commit is contained in:
parent
6ab6ed801a
commit
3a34249e0e
1 changed files with 31 additions and 0 deletions
|
|
@ -585,6 +585,12 @@ describe('set scheduling', () => {
|
||||||
cy.get('input[value="middle"]').should('be.checked')
|
cy.get('input[value="middle"]').should('be.checked')
|
||||||
cy.get('input[value="end"]').check()
|
cy.get('input[value="end"]').check()
|
||||||
})
|
})
|
||||||
|
cy.viewport(375, 667)
|
||||||
|
cy.document().then((document) => {
|
||||||
|
expect(document.documentElement.scrollWidth).to.be.at.most(
|
||||||
|
document.documentElement.clientWidth,
|
||||||
|
)
|
||||||
|
})
|
||||||
cy.get('[data-reschedule-form]').submit()
|
cy.get('[data-reschedule-form]').submit()
|
||||||
cy.wait('@reschedule')
|
cy.wait('@reschedule')
|
||||||
|
|
||||||
|
|
@ -648,6 +654,31 @@ describe('set scheduling', () => {
|
||||||
cy.get('[data-reschedule-toggle]').should('not.exist')
|
cy.get('[data-reschedule-toggle]').should('not.exist')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('keeps the current plan visible when rescheduling fails', () => {
|
||||||
|
cy.clock(new Date(2026, 7, 15, 12).getTime(), ['Date'])
|
||||||
|
cy.intercept('GET', '**/api/schedules/73', {
|
||||||
|
statusCode: 200,
|
||||||
|
body: rescheduleSourceDetail,
|
||||||
|
}).as('schedule')
|
||||||
|
cy.intercept('PATCH', '**/api/schedules/73', {
|
||||||
|
statusCode: 500,
|
||||||
|
body: { error: 'Rescheduling is temporarily unavailable.' },
|
||||||
|
}).as('reschedule')
|
||||||
|
|
||||||
|
cy.visit('/schedules/73')
|
||||||
|
cy.wait('@me')
|
||||||
|
cy.wait('@schedule')
|
||||||
|
cy.get('[data-reschedule-toggle]').click()
|
||||||
|
cy.get('[data-reschedule-form]').submit()
|
||||||
|
cy.wait('@reschedule')
|
||||||
|
|
||||||
|
cy.get('[data-reschedule-form]')
|
||||||
|
.should('be.visible')
|
||||||
|
.and('contain.text', 'Rescheduling is temporarily unavailable.')
|
||||||
|
cy.get('.schedule-range').should('contain.text', 'Aug 10, 2026 to Aug 20, 2026')
|
||||||
|
cy.get('[data-reschedule-announcement]').should('have.text', '')
|
||||||
|
})
|
||||||
|
|
||||||
it('completes and reopens assignments from the schedule', () => {
|
it('completes and reopens assignments from the schedule', () => {
|
||||||
const completedAt = '2026-08-15T12:30:00+00:00'
|
const completedAt = '2026-08-15T12:30:00+00:00'
|
||||||
cy.intercept('GET', '**/api/schedules/73', {
|
cy.intercept('GET', '**/api/schedules/73', {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue