Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions packages/components/input/__tests__/input.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from "react";
import {render, waitFor} from "@testing-library/react";
import {render} from "@testing-library/react";

import {Input} from "../src";

Expand Down Expand Up @@ -99,7 +99,8 @@ describe("Input", () => {

expect(onFocus).toHaveBeenCalledTimes(1);
});
it("ref should update the value", async () => {

it("ref should update the value", () => {
const ref = React.createRef<HTMLInputElement>();

const {container} = render(<Input ref={ref} type="text" />);
Expand All @@ -113,11 +114,6 @@ describe("Input", () => {

container.querySelector("input")?.focus();

await waitFor(() => {
return expect(ref.current?.value)?.toBe(value);
});
await waitFor(() => {
return expect(ref.current?.value)?.toBe(value);
});
expect(ref.current?.value)?.toBe(value);
});
});