Skip to content

Commit

Permalink
fixup! fix(datepicker): add test for parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
blm768 committed Apr 16, 2024
1 parent 4c1de19 commit 8712a04
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/oruga/src/components/datepicker/tests/datepicker.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,18 @@ describe("ODatepicker", () => {
"2024-04-10T00:00:00.000Z",
);
});

test("handles invalid keyboard input", () => {
const wrapper = mount(ODatepicker, { props: { readonly: false } });

const target = wrapper.find("input");
expect(target.exists()).toBeTruthy();
target.setValue("not-a-date");

const updates = wrapper.emitted("update:modelValue");
expect(updates).toHaveLength(1);
expect(updates[0]).toHaveLength(1);
const updateValue = updates[0][0];
expect(updateValue).toBeNull();
});
});

0 comments on commit 8712a04

Please sign in to comment.