Skip to content

Commit 6b1d735

Browse files
committed
test(e2e): fix datepicker
1 parent 0e1429e commit 6b1d735

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

e2e/date-picker.e2e.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,12 +269,11 @@ test.describe("datepicker [range]", () => {
269269
test("should not crash when changing end date after typing end date first", async () => {
270270
// Regression test for issue #2864
271271
// 1. Type a valid end date first (e.g. 06/15/2024)
272-
await I.focusInput(1)
273272
await I.type("06/15/2024", 1)
274273
await I.clickOutsideToBlur()
275274

276275
// 2. Change the end date by typing a new value (e.g., 06/15/2025)
277-
await I.focusInput(1)
276+
await I.selectInput(1)
278277
await I.type("06/15/2025", 1)
279278
await I.clickOutsideToBlur()
280279

e2e/models/datepicker.model.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ export class DatePickerModel extends Model {
148148
return this.getInput(index).focus()
149149
}
150150

151+
selectInput(index = 0) {
152+
return this.getInput(index).selectText()
153+
}
154+
151155
async clearInput(index = 0) {
152156
await this.focusInput(index)
153157
await this.pressKey("ControlOrMeta+A")

0 commit comments

Comments
 (0)