fix: e2e test (#2828)

Co-authored-by: Alex Yang <himself65@outlook.com>
This commit is contained in:
3720
2023-06-20 17:15:49 +08:00
committed by GitHub
parent 6f9bb024be
commit 019a2f57cb

View File

@@ -195,9 +195,10 @@ const selectDateFromDatePicker = async (page: Page, date: Date) => {
);
await nextMonthButton.click();
}
const map = ['th', 'st', 'nd', 'rd']
// Click on the day cell
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();
};