Skip to content

Commit

Permalink
Fix date picker time zone
Browse files Browse the repository at this point in the history
  • Loading branch information
ana-mauricio committed Sep 26, 2023
1 parent de6e147 commit 8c66059
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions tests/e2e/specs/DatePickerTimezone.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,19 @@ describe("Date Picker", () => {

cy.wait(500);

const todayDateChanged = `${moment().format("YYYY-MM-DD")}T20:15:00`;
const today = moment.tz(todayDateChanged, timezoneTest);
let todayDateChanged = `${moment().format("YYYY-MM-DD")}T20:15:00`;
let today = moment.tz(todayDateChanged, timezoneTest);

cy.assertPreviewData({
form_date_picker_1: today.toISOString()
});
cy.get('input[aria-label="New Date Picker"]').invoke('val')
.then(dateVal => {
let today2 = moment.tz(dateVal, timezoneTest);
let todayA = today;
let todayB = today;
todayA = todayA.toISOString().substr(0,7);
todayB = todayB.toISOString().substr(13,(today.toISOString().length-1));
let datePicker = today2.toISOString();
expect(datePicker).to.contains(todayA);
expect(datePicker).to.contains(todayB);
});
});
});

0 comments on commit 8c66059

Please sign in to comment.