This repository has been archived by the owner on Oct 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: cover TracingCaseContactDetail
Co-authored-by: Resi Respati <resir014@gmail.com>
- Loading branch information
1 parent
0c4e1b1
commit f1616a2
Showing
6 changed files
with
86 additions
and
7 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
__tests__/pages/dashboard/tracing/[caseId]/[contactId]/index.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { render, screen } from "@testing-library/react"; | ||
import React from "react"; | ||
import TracingCaseContactDetail from "~/pages/dashboard/tracing/[caseId]/[contactId]"; | ||
|
||
jest.mock("next/router", () => require("next-router-mock")); | ||
|
||
describe("TracingCaseContactDetail", () => { | ||
it("renders page title correctly", () => { | ||
render(<TracingCaseContactDetail />); | ||
|
||
expect(screen.getByRole("heading", { name: /detail kontak erat/i })).toBeVisible(); | ||
}); | ||
|
||
it("renders the `Kembali` button correctly", () => { | ||
render(<TracingCaseContactDetail />); | ||
|
||
expect(screen.getByRole("link", { name: /kembali/i })).toHaveAttribute( | ||
"href", | ||
"/dashboard/tracing/undefined" | ||
); | ||
}); | ||
}); |
22 changes: 22 additions & 0 deletions
22
__tests__/pages/dashboard/tracing/[caseId]/[contactId]/monitor.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { render, screen } from "@testing-library/react"; | ||
import React from "react"; | ||
import Monitor from "~/pages/dashboard/tracing/[caseId]/[contactId]/monitor"; | ||
|
||
jest.mock("next/router", () => require("next-router-mock")); | ||
|
||
describe("Monitor", () => { | ||
it("renders page title correctly", () => { | ||
render(<Monitor />); | ||
|
||
expect(screen.getByRole("heading", { name: /tambah pemantauan/i })).toBeVisible(); | ||
}); | ||
|
||
it("renders the `Kembali` button correctly", () => { | ||
render(<Monitor />); | ||
|
||
expect(screen.getByRole("link", { name: /kembali/i })).toHaveAttribute( | ||
"href", | ||
"/dashboard/tracing/undefined/undefined" | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters