We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent be5c80b commit bce6109Copy full SHA for bce6109
1 file changed
src/components/SearchResult/__test__/featureactiverow.test.jsx
@@ -0,0 +1,32 @@
1
+import TableBody from "../TableBody";
2
+import { render, screen, fireEvent } from "@testing-library/react";
3
+
4
+test("Verify that each row of your table can be highlighted (on and off) independently when being clicked.", () => {
5
+ render(
6
+ <table>
7
+ <tbody>
8
+ <TableBody
9
+ id={1}
10
+ title={"tab"}
11
+ name={"he"}
12
+ firstName={"gr"}
13
+ surName={"dj"}
14
+ email={"df"}
15
+ roomId={"kd"}
16
+ checkInDate={"fd"}
17
+ checkOutDate={"v"}
18
+ stayNights={"om"}
19
+ />
20
+ </tbody>
21
+ </table>
22
+ );
23
24
+ const tableRows = screen.getAllByRole("row");
25
26
+ tableRows.forEach((row) => {
27
+ fireEvent.click(row);
28
+ expect(row).toHaveClass("selected");
29
30
+ expect(row).not.toHaveClass("selected");
31
+ });
32
+});
0 commit comments