Skip to content

Commit

Permalink
[EntryCellComponents] Move tests to @testing-library (#3304)
Browse files Browse the repository at this point in the history
  • Loading branch information
imnasnainaec authored Aug 14, 2024
1 parent 7e2337b commit f3e35ba
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createRef } from "react";
import renderer from "react-test-renderer";
import { render } from "@testing-library/react";
import { act, createRef } from "react";

import GlossWithSuggestions from "components/DataEntry/DataEntryTable/EntryCellComponents/GlossWithSuggestions";
import { newWritingSystem } from "types/writingSystem";
Expand All @@ -17,8 +17,8 @@ jest.mock("@mui/base/node/useAutocomplete/useAutocomplete", () => ({

describe("GlossWithSuggestions", () => {
it("renders with gloss", () => {
renderer.act(() => {
renderer.create(
act(() => {
render(
<GlossWithSuggestions
gloss={"gloss"}
glossInput={createRef<HTMLInputElement>()}
Expand All @@ -32,8 +32,8 @@ describe("GlossWithSuggestions", () => {
});

it("renders new", () => {
renderer.act(() => {
renderer.create(
act(() => {
render(
<GlossWithSuggestions
isNew
gloss={""}
Expand All @@ -48,8 +48,8 @@ describe("GlossWithSuggestions", () => {
});

it("renders disabled", () => {
renderer.act(() => {
renderer.create(
act(() => {
render(
<GlossWithSuggestions
isDisabled
gloss={""}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createRef } from "react";
import renderer from "react-test-renderer";
import { render } from "@testing-library/react";
import { act, createRef } from "react";

import VernWithSuggestions from "components/DataEntry/DataEntryTable/EntryCellComponents/VernWithSuggestions";
import { newWritingSystem } from "types/writingSystem";
Expand All @@ -17,8 +17,8 @@ jest.mock("@mui/base/node/useAutocomplete/useAutocomplete", () => ({

describe("VernWithSuggestions", () => {
it("renders with vernacular", () => {
renderer.act(() => {
renderer.create(
act(() => {
render(
<VernWithSuggestions
vernacular={"vern"}
vernInput={createRef<HTMLInputElement>()}
Expand All @@ -33,8 +33,8 @@ describe("VernWithSuggestions", () => {
});

it("renders new", () => {
renderer.act(() => {
renderer.create(
act(() => {
render(
<VernWithSuggestions
isNew
vernacular={""}
Expand All @@ -50,8 +50,8 @@ describe("VernWithSuggestions", () => {
});

it("renders disabled", () => {
renderer.act(() => {
renderer.create(
act(() => {
render(
<VernWithSuggestions
isDisabled
vernacular={""}
Expand Down

0 comments on commit f3e35ba

Please sign in to comment.