test overdue dashboard assignments

This commit is contained in:
Yisroel Baum 2026-08-18 00:13:24 +03:00
parent 2c38b01562
commit 7bc7ad207b
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
3 changed files with 42 additions and 26 deletions

View file

@ -36,6 +36,7 @@ describe("today's assignments", () => {
assignments: [
{
id: 12,
scheduledDate: '2026-08-13',
schedule: {
id: 73,
set: { name: 'Bible' },
@ -48,6 +49,7 @@ describe("today's assignments", () => {
},
{
id: 13,
scheduledDate: browserToday,
schedule: {
id: 81,
set: { name: 'Course' },
@ -77,6 +79,16 @@ describe("today's assignments", () => {
'have.length',
2,
)
cy.get('[data-today-assignment]')
.first()
.should('have.attr', 'data-today-assignment', '12')
cy.get('[data-today-assignment="12"] .today-assignment__overdue').should(
'have.text',
'Overdue · Due Aug 13, 2026',
)
cy.get('[data-today-assignment="13"] .today-assignment__overdue').should(
'not.exist',
)
cy.contains('a', 'Genesis / Creation / Chapter 1')
.should('contain.text', 'Bible')
.and('have.attr', 'href', '/schedules/73')
@ -109,7 +121,7 @@ describe("today's assignments", () => {
cy.get('.today-assignments [role="status"]').should(
'contain.text',
'Nothing is assigned for today.',
'Nothing is due today.',
)
})
@ -121,6 +133,7 @@ describe("today's assignments", () => {
assignments: [
{
id: 12,
scheduledDate: browserToday,
schedule: {
id: 73,
set: { name: 'Bible' },
@ -177,7 +190,7 @@ describe("today's assignments", () => {
cy.get('[data-today-assignment="12"]').should('not.exist')
cy.get('.today-assignments [role="status"]').should(
'contain.text',
'Nothing is assigned for today.',
'Nothing is due today.',
)
})
@ -219,7 +232,7 @@ describe("today's assignments", () => {
cy.get('.today-assignments [role="status"]').should(
'contain.text',
'Nothing is assigned for today.',
'Nothing is due today.',
)
})
})