Skip to content

Commit

Permalink
test: fix e2e due to the new year :)
Browse files Browse the repository at this point in the history
  • Loading branch information
segunadebayo committed Jan 1, 2025
1 parent e8c9761 commit 1aca991
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions e2e/date-picker.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import { DatePickerModel } from "./models/datepicker.model"
let I: DatePickerModel

test.describe("datepicker [single]", () => {
const currentDate = new Date()
const year = currentDate.getFullYear()

test.beforeEach(async ({ page }) => {
I = new DatePickerModel(page)
await I.goto()
Expand Down Expand Up @@ -77,19 +80,19 @@ test.describe("datepicker [single]", () => {
})

test("keyboard selection", async () => {
await I.type("02/28/2024")
await I.type(`02/28/${year}`)
await I.pressKey("Enter")
await I.seeInputHasValue("02/28/2024")
await I.seeInputHasValue(`02/28/${year}`)
})

test("keyboard selection + re-selection", async () => {
await I.type("02/28/2024")
await I.type(`02/28/${year}`)
await I.pressKey("Enter")
await I.seeInputHasValue("02/28/2024")
await I.seeInputHasValue(`02/28/${year}`)

await I.pressKey("Backspace", 5) // becomes 02/28
await I.pressKey("Enter")
await I.seeInputHasValue("02/28/2024")
await I.seeInputHasValue(`02/28/${year}`)
})

// test("click trigger + focus input + selection, set value in input", async () => {
Expand Down

0 comments on commit 1aca991

Please sign in to comment.