Skip to content

Commit

Permalink
fix input fill
Browse files Browse the repository at this point in the history
  • Loading branch information
larsrickert committed Nov 25, 2024
1 parent a2f6b7f commit 97dcf43
Showing 1 changed file with 4 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,31 +67,12 @@ test("should emit events", async ({ mount, makeAxeBuilder }) => {
const inputElement = component.getByLabel("Label");

// ACT
await inputElement.pressSequentially("25");

// ASSERT
await expect(inputElement).toHaveValue("");
expect(events).toMatchObject({ updateModelValue: [] });

// ACT
await inputElement.pressSequentially("11");

// ASSERT
await expect(inputElement).toHaveValue("");
expect(events).toMatchObject({ updateModelValue: [] });

// ACT
await inputElement.pressSequentially("2024");
await inputElement.fill("2024-11-25");

// ASSERT
await expect(inputElement).toHaveValue("2024-11-25");
expect(events).toMatchObject({
updateModelValue: [
"0002-11-25T00:00:00.000Z",
"0020-11-25T00:00:00.000Z",
"0202-11-25T00:00:00.000Z",
"2024-11-25T00:00:00.000Z",
],
updateModelValue: ["2024-11-25T00:00:00.000Z"],
});
});

Expand Down Expand Up @@ -126,10 +107,7 @@ test("should show error message after interaction", async ({ mount, makeAxeBuild

// ACT: interact with the input
await input.focus();
await input.pressSequentially("25");
await input.pressSequentially("11");
await input.pressSequentially("2024");
await input.fill("");
await input.fill("2024-11-25");
await input.blur();

// ASSERT: after interaction, the error preview shows
Expand Down Expand Up @@ -166,10 +144,7 @@ test("should show correct message", async ({ mount }) => {

//ACT
await input.click();
await input.pressSequentially("25");
await input.pressSequentially("11");
await input.pressSequentially("2024");
await input.fill("");
await input.fill("2024-11-25");
await input.blur();

// ASSERT
Expand Down

0 comments on commit 97dcf43

Please sign in to comment.