-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.test.tsx
38 lines (34 loc) · 926 Bytes
/
index.test.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/**
*
* Tests for RepoList
*
*/
import React from "react";
import { render } from "@utils/testUtils";
import RepoList from "../index";
describe("<RepoList />", () => {
const repoListProps = {
loading: true,
repoName: "Nextjs Bulletproof Template",
reposData: {
totalCount: 1,
incompleteResults: false,
items: [
{
name: "Nextjs Bulletproof",
fullName: "Nextjs Bulletproof Template",
stargazersCount: 100,
owner: { login: "Wednesday Solutions" },
},
],
},
};
it("should render and match the snapshot", () => {
const { baseElement } = render(<RepoList {...repoListProps} />);
expect(baseElement).toMatchSnapshot();
});
it("should contain 1 RepoList component", () => {
const { getAllByTestId } = render(<RepoList {...repoListProps} />);
expect(getAllByTestId("repo-list").length).toBe(1);
});
});