Skip to content

Commit

Permalink
[FIX] unit test error
Browse files Browse the repository at this point in the history
  • Loading branch information
songforthemute committed Sep 29, 2023
1 parent 2473407 commit 014adb2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
4 changes: 1 addition & 3 deletions src/__test__/organic.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ describe("Components: Organics unit test", () => {
expect(emailLabel).toBeInTheDocument();
expect(passwordLabel).toBeInTheDocument();

const resetBtn = screen.getByRole("button", {
name: "비밀번호를 잊으셨나요?",
});
const resetBtn = screen.getByText("비밀번호를 잊으셨나요?");
expect(resetBtn).toBeInTheDocument();
expect(resetBtn).toBeEnabled();

Expand Down
5 changes: 2 additions & 3 deletions src/__test__/pages/job/job.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { act, screen } from "@testing-library/react";
import mockRouter from "next-router-mock";
import { useThemeRenderWithRedux } from "@libs/jest-utils";
import Job from "../../../pages/job";
import userEvent from "@testing-library/user-event";

jest.mock("next/router", () => require("next-router-mock"));

Expand Down Expand Up @@ -32,11 +31,11 @@ describe("/job 페이지 테스트", () => {
await mockRouter.push("/job");
});

const addBtn = screen.getByRole("button", { name: /추가/ });
const addBtn = screen.getByText("추가");
expect(addBtn).toBeInTheDocument();
expect(addBtn).toBeEnabled();

const recommendBtn = screen.getByRole("button", { name: /추천+/ });
const recommendBtn = screen.getByText("추천받기");
expect(recommendBtn).toBeInTheDocument();
expect(recommendBtn).toBeEnabled();

Expand Down
8 changes: 5 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@
"@components/*": ["./src/components/*"],
"@contexts/*": ["./src/contexts/*"]
// "@/*": ["./src/*"]
}
},
// "typeRoots": ["./node_modules/@types"],
"types": ["node", "jest", "@testing-library/jest-dom"]
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
"include": ["**/*.ts", "**/*.tsx"],
"exclude": ["node_modules", "./cypress.config.ts", "cypress"]
}

0 comments on commit 014adb2

Please sign in to comment.