fix: e2e test (#2828)
Co-authored-by: Alex Yang <himself65@outlook.com>
This commit is contained in:
@@ -195,9 +195,10 @@ const selectDateFromDatePicker = async (page: Page, date: Date) => {
|
|||||||
);
|
);
|
||||||
await nextMonthButton.click();
|
await nextMonthButton.click();
|
||||||
}
|
}
|
||||||
|
const map = ['th', 'st', 'nd', 'rd']
|
||||||
// Click on the day cell
|
// Click on the day cell
|
||||||
const dateCell = page.locator(
|
const dateCell = page.locator(
|
||||||
`[aria-disabled="false"][aria-label="Choose ${weekday}, ${month} ${day}th, ${year}"]`
|
`[aria-disabled="false"][aria-label="Choose ${weekday}, ${month} ${day}${map[Number.parseInt(day) % 10] ?? 'th'}, ${year}"]`
|
||||||
);
|
);
|
||||||
await dateCell.click();
|
await dateCell.click();
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user