Skip to content

Commit

Permalink
test(component-library): allow editing the value when inheritance in …
Browse files Browse the repository at this point in the history
…email field is unlinked
  • Loading branch information
Haberkamp committed Jan 24, 2025
1 parent f0c9a79 commit 3c33de6
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,30 @@ describe("mt-email-field", () => {
expect(screen.getByRole("textbox")).toHaveValue("");
});

it("it is possible to edit the value when the inheritance is unlinked", async () => {
// ARRANGE
const handler = vi.fn();

render(MtEmailField, {
props: {
isInheritanceField: true,
isInherited: false,
"onUpdate:modelValue": handler,
},
});

const user = userEvent.setup({
advanceTimers: vi.advanceTimersByTime,
});

// ACT
await user.type(screen.getByRole("textbox"), "a");

// ASSERT
expect(handler).toHaveBeenCalledOnce();
expect(screen.getByRole("textbox")).toHaveValue("a");
});

it("shows a tooltip when focusing the button to copy the input value", async () => {
// ARRANGE
render(MtEmailField, {
Expand Down

0 comments on commit 3c33de6

Please sign in to comment.