-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Dominik Bláha
committed
Jan 20, 2022
1 parent
05d4ce8
commit 22a7c5a
Showing
9 changed files
with
4,173 additions
and
1 deletion.
There are no files selected for viewing
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
35 changes: 35 additions & 0 deletions
35
packages/frontend/src/pages/IssueDetail/IssueDetail.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,35 @@ | ||
import renderer from "react-test-renderer" | ||
import { IssueDetail } from "./IssueDetail" | ||
import { testData } from "../../testData" | ||
import { MemoryRouter, Route } from "react-router-dom" | ||
|
||
const project = testData.projects[0] | ||
const issue = project.issues[0] | ||
|
||
describe("IssueDetail page", () => { | ||
it("should renders correctly", () => { | ||
const tree = renderer.create( | ||
<MemoryRouter | ||
initialEntries={[`/${project.owner}/${project.repo}/${issue.number}`]} | ||
> | ||
<Route | ||
path="/:owner/:project/:issue" | ||
render={(props) => <IssueDetail {...props} data={testData} />} | ||
/> | ||
</MemoryRouter> | ||
) | ||
expect(tree).toMatchSnapshot() | ||
}) | ||
|
||
it("should renders correctly if there is no related issue", () => { | ||
const tree = renderer.create( | ||
<MemoryRouter initialEntries={[`/${project.owner}/${project.repo}/0`]}> | ||
<Route | ||
path="/:owner/:project/:issue" | ||
render={(props) => <IssueDetail {...props} data={testData} />} | ||
/> | ||
</MemoryRouter> | ||
) | ||
expect(tree).toMatchSnapshot() | ||
}) | ||
}) |
Oops, something went wrong.