diff --git a/cypress/e2e/50_adminCustomDateSelect.cy.ts b/cypress/e2e/50_adminCustomDateSelect.cy.ts index 3d4a7b31..b76e41c8 100644 --- a/cypress/e2e/50_adminCustomDateSelect.cy.ts +++ b/cypress/e2e/50_adminCustomDateSelect.cy.ts @@ -58,10 +58,18 @@ describe('Admin Statistics Custom Date Range', () => { cy.contains('25').should('exist'); cy.wait(1000); - const expectedStartDateFormat = `${String(startDate.getDate()).padStart( + let expectedStartDateFormat = `${String(startDate.getDate()).padStart( 2, '0' )} ${startDate.toLocaleString('default', { month: 'short' })}`; + + if (startDate.getMonth() === 0) { + expectedStartDateFormat = `${String(startDate.getDate()).padStart( + 2, + '0' + )} ${startDate.toLocaleString('default', { month: 'short' })} ${endDate.getFullYear()}`; + } + const expectedEndDateFormat = `${String(endDate.getDate()).padStart( 2, '0'