From 019a2f57cb9736032684d83e6d2149f17016407b Mon Sep 17 00:00:00 2001 From: 3720 Date: Tue, 20 Jun 2023 17:15:49 +0800 Subject: [PATCH] fix: e2e test (#2828) Co-authored-by: Alex Yang --- tests/parallels/all-page.spec.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/parallels/all-page.spec.ts b/tests/parallels/all-page.spec.ts index 51311dffa..fb8b899f1 100644 --- a/tests/parallels/all-page.spec.ts +++ b/tests/parallels/all-page.spec.ts @@ -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(); };