-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathPrevPointTableHead.test.js
More file actions
43 lines (38 loc) · 1.2 KB
/
PrevPointTableHead.test.js
File metadata and controls
43 lines (38 loc) · 1.2 KB
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
39
40
41
42
43
import { render } from "@testing-library/react"
import React from "react"
import PrevPointTableHead from "./../src/components/ParticipantTableComponent/PrevPointTableHead"
let table
let tableContainer
describe("<PrevPointTableHead />", () => {
beforeEach(() => {
table = document.createElement("table")
tableContainer = {
container: document.body.appendChild(table),
}
})
it("should render a PrevPointTableHead component", () => {
render(<PrevPointTableHead />, tableContainer)
})
it("should render a PrevPointTableHead and have a TableHead element", () => {
const { getByLabelText } = render(<PrevPointTableHead />, tableContainer)
const tableHeadElement = getByLabelText(/thead/i)
expect(tableHeadElement).toBeInTheDocument()
})
it("should render a PrevPointTableHead and have 7 columns", () => {
const titles = [
"PPID",
"First Name",
"Last Name",
"Gender",
"DOB",
"Race",
"Edit Participant",
]
const { getAllByLabelText } = render(
<PrevPointTableHead headerTitles={titles} />,
tableContainer
)
const tableCellList = getAllByLabelText("cell")
expect(tableCellList).toHaveLength(7)
})
})