Skip to content

Commit

Permalink
remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
lkleuver committed Jul 15, 2024
1 parent e514902 commit c207e29
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions frontend/app/test/unit/test-utils.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,10 @@
import { ReactElement } from "react";
import { Providers } from "./Providers";

import { render, RenderOptions, RenderResult, fireEvent } from "@testing-library/react";
import { render, RenderOptions } from "@testing-library/react";

const customRender = (ui: ReactElement, options?: Omit<RenderOptions, "wrapper">) => {
const result: RenderResult = render(ui, { wrapper: Providers, ...options });

const fillFormValues = (values: Record<string, string | number>) => {
Object.keys(values).forEach((key) => {
const input = result.getByTestId(key);
fireEvent.change(input, { target: { value: values[key] } });
});
};

return {
...result,
fillFormValues,
};
};
const customRender = (ui: ReactElement, options?: Omit<RenderOptions, "wrapper">) =>
render(ui, { wrapper: Providers, ...options });

export * from "@testing-library/react";
export { customRender as render };
Expand Down

0 comments on commit c207e29

Please sign in to comment.