Skip to content

Commit

Permalink
fix: cypress test
Browse files Browse the repository at this point in the history
  • Loading branch information
elraphty committed Jan 13, 2025
1 parent bd7ef4b commit ca89a7c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cypress/e2e/50_adminCustomDateSelect.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit ca89a7c

Please sign in to comment.