test workload placement
This commit is contained in:
parent
80f8031ecc
commit
465db4a5b8
4 changed files with 345 additions and 0 deletions
|
|
@ -60,6 +60,13 @@ const bibleLayout = {
|
|||
],
|
||||
}
|
||||
|
||||
const overloadedBibleLayout = {
|
||||
...bibleLayout,
|
||||
levels: bibleLayout.levels.map((level) =>
|
||||
level.id === 3 ? { ...level, elementCount: 11 } : level,
|
||||
),
|
||||
}
|
||||
|
||||
const scheduleDetail = {
|
||||
schedule: {
|
||||
id: 73,
|
||||
|
|
@ -194,6 +201,7 @@ describe('set scheduling', () => {
|
|||
levelId: 3,
|
||||
startDate: '2026-08-10',
|
||||
targetDate: '2026-08-12',
|
||||
workloadPlacement: 'middle',
|
||||
})
|
||||
request.reply({ statusCode: 201, body: scheduleDetail })
|
||||
}).as('createSchedule')
|
||||
|
|
@ -244,6 +252,40 @@ describe('set scheduling', () => {
|
|||
)
|
||||
})
|
||||
|
||||
it('places heavier days where the user chooses', () => {
|
||||
cy.intercept('GET', '**/api/sets/41', {
|
||||
statusCode: 200,
|
||||
body: overloadedBibleLayout,
|
||||
}).as('layout')
|
||||
cy.intercept('POST', '**/api/schedules', (request) => {
|
||||
expect(request.body).to.deep.equal({
|
||||
setId: 41,
|
||||
levelId: 3,
|
||||
startDate: '2026-08-10',
|
||||
targetDate: '2026-08-14',
|
||||
workloadPlacement: 'end',
|
||||
})
|
||||
request.reply({ statusCode: 201, body: scheduleDetail })
|
||||
}).as('createSchedule')
|
||||
|
||||
cy.visit('/sets/41/schedules/new')
|
||||
cy.wait('@me')
|
||||
cy.wait('@layout')
|
||||
cy.get('[data-workload-placement]').should('not.exist')
|
||||
|
||||
cy.get('#schedule-level').select('3')
|
||||
cy.get('#schedule-start-date').type('2026-08-10')
|
||||
cy.get('#schedule-target-date').type('2026-08-14')
|
||||
|
||||
cy.get('[data-workload-placement]').should('be.visible').within(() => {
|
||||
cy.contains('legend', 'Heavier days').should('be.visible')
|
||||
cy.get('input[value="middle"]').should('be.checked')
|
||||
cy.get('input[value="end"]').check()
|
||||
})
|
||||
cy.get('form').submit()
|
||||
cy.wait('@createSchedule')
|
||||
})
|
||||
|
||||
it('validates the schedule form before submitting', () => {
|
||||
cy.intercept('GET', '**/api/sets/41', {
|
||||
statusCode: 200,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue