Compare commits
No commits in common. "0b4465ec47fdb38dba539e722b5d4bb4205abbae" and "d2002eccb9ed8f6e1619bf181e30896ad641ebb4" have entirely different histories.
0b4465ec47
...
d2002eccb9
2 changed files with 7 additions and 8 deletions
|
|
@ -138,11 +138,9 @@ const completedScheduleDetail = {
|
||||||
const splitScheduleDetail = {
|
const splitScheduleDetail = {
|
||||||
schedule: {
|
schedule: {
|
||||||
...scheduleDetail.schedule,
|
...scheduleDetail.schedule,
|
||||||
startDate: '2026-08-09',
|
|
||||||
targetDate: '2026-08-13',
|
targetDate: '2026-08-13',
|
||||||
assignmentCount: 4,
|
assignmentCount: 4,
|
||||||
days: [
|
days: [
|
||||||
{ date: '2026-08-09', assignments: [] },
|
|
||||||
scheduleDetail.schedule.days[0],
|
scheduleDetail.schedule.days[0],
|
||||||
scheduleDetail.schedule.days[1],
|
scheduleDetail.schedule.days[1],
|
||||||
{
|
{
|
||||||
|
|
@ -300,7 +298,6 @@ describe('set scheduling', () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
it('creates a schedule from a set and shows every day', () => {
|
it('creates a schedule from a set and shows every day', () => {
|
||||||
cy.clock(new Date(2026, 7, 10, 12).getTime(), ['Date'])
|
|
||||||
cy.intercept('GET', '**/api/sets/41', {
|
cy.intercept('GET', '**/api/sets/41', {
|
||||||
statusCode: 200,
|
statusCode: 200,
|
||||||
body: bibleLayout,
|
body: bibleLayout,
|
||||||
|
|
@ -521,7 +518,6 @@ describe('set scheduling', () => {
|
||||||
cy.get('[data-schedule-date="2026-08-10"]')
|
cy.get('[data-schedule-date="2026-08-10"]')
|
||||||
.should('contain.text', 'Overdue')
|
.should('contain.text', 'Overdue')
|
||||||
.and('contain.text', 'Genesis / Creation / Chapter 1')
|
.and('contain.text', 'Genesis / Creation / Chapter 1')
|
||||||
cy.get('[data-schedule-date="2026-08-09"]').should('not.exist')
|
|
||||||
cy.get('[data-schedule-date="2026-08-11"]')
|
cy.get('[data-schedule-date="2026-08-11"]')
|
||||||
.should('contain.text', 'Rest day')
|
.should('contain.text', 'Rest day')
|
||||||
.and('not.contain.text', 'Overdue')
|
.and('not.contain.text', 'Overdue')
|
||||||
|
|
@ -611,6 +607,10 @@ describe('set scheduling', () => {
|
||||||
cy.get('.schedule-range').should('contain.text', 'Aug 10, 2026 to Aug 16, 2026')
|
cy.get('.schedule-range').should('contain.text', 'Aug 10, 2026 to Aug 16, 2026')
|
||||||
cy.get('[data-assignment-section="remaining"] [data-schedule-day]').then(($days) => {
|
cy.get('[data-assignment-section="remaining"] [data-schedule-day]').then(($days) => {
|
||||||
expect([...$days].map((day) => day.getAttribute('data-schedule-date'))).to.deep.equal([
|
expect([...$days].map((day) => day.getAttribute('data-schedule-date'))).to.deep.equal([
|
||||||
|
'2026-08-11',
|
||||||
|
'2026-08-12',
|
||||||
|
'2026-08-13',
|
||||||
|
'2026-08-14',
|
||||||
'2026-08-15',
|
'2026-08-15',
|
||||||
'2026-08-16',
|
'2026-08-16',
|
||||||
])
|
])
|
||||||
|
|
@ -689,7 +689,6 @@ describe('set scheduling', () => {
|
||||||
|
|
||||||
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.clock(new Date(2026, 7, 15, 12).getTime(), ['Date'])
|
|
||||||
cy.intercept('GET', '**/api/schedules/73', {
|
cy.intercept('GET', '**/api/schedules/73', {
|
||||||
statusCode: 200,
|
statusCode: 200,
|
||||||
body: completedScheduleDetail,
|
body: completedScheduleDetail,
|
||||||
|
|
@ -734,7 +733,7 @@ describe('set scheduling', () => {
|
||||||
cy.get('[data-assignment-section="remaining"]')
|
cy.get('[data-assignment-section="remaining"]')
|
||||||
.should('have.attr', 'data-assignment-count', '0')
|
.should('have.attr', 'data-assignment-count', '0')
|
||||||
.and('contain.text', 'All assignments are complete.')
|
.and('contain.text', 'All assignments are complete.')
|
||||||
.and('not.contain.text', 'Rest day')
|
.and('contain.text', 'Rest day')
|
||||||
cy.get('[data-assignment-section="completed"]')
|
cy.get('[data-assignment-section="completed"]')
|
||||||
.should('have.attr', 'data-assignment-count', '2')
|
.should('have.attr', 'data-assignment-count', '2')
|
||||||
.within(() => {
|
.within(() => {
|
||||||
|
|
|
||||||
|
|
@ -42,9 +42,9 @@ const remainingDays = computed<ScheduleDay[]>(() => {
|
||||||
return schedule.days.flatMap((day) => {
|
return schedule.days.flatMap((day) => {
|
||||||
const assignments = day.assignments.filter((assignment) => assignment.completedAt === null)
|
const assignments = day.assignments.filter((assignment) => assignment.completedAt === null)
|
||||||
const isActiveDate = day.date >= schedule.startDate && day.date <= schedule.targetDate
|
const isActiveDate = day.date >= schedule.startDate && day.date <= schedule.targetDate
|
||||||
const isVisibleRestDay = isActiveDate && day.assignments.length === 0 && day.date >= todayDate
|
const isRestDay = isActiveDate && day.assignments.length === 0
|
||||||
|
|
||||||
return assignments.length > 0 || isVisibleRestDay ? [{ date: day.date, assignments }] : []
|
return assignments.length > 0 || isRestDay ? [{ date: day.date, assignments }] : []
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue