Skip to content

Commit

Permalink
Fix unreliable date math bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Valerie Young committed Nov 30, 2020
1 parent 2ba78e3 commit 35c889e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/tests/spinbutton_datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,7 @@ ariaTest(

ariaTest('up arrow on month', exampleFile, 'spinbutton-up-arrow', async (t) => {
let date = new Date();
date.setDate(1); // This is necessary to do the correct date math for months.

let monthSpinner = await t.context.session.findElement(
By.css(ex.monthSelector)
Expand All @@ -417,7 +418,6 @@ ariaTest('up arrow on month', exampleFile, 'spinbutton-up-arrow', async (t) => {
for (let i = 1; i <= 12; i++) {
await monthSpinner.sendKeys(Key.ARROW_UP);
const index = new Date(date.setMonth(date.getMonth() + 1)).getMonth();
console.log(index);
t.is(
await monthSpinner.getText(),
valuesMonth[index],
Expand Down

0 comments on commit 35c889e

Please sign in to comment.