|
1 | 1 | import React, { act } from "react"; |
2 | 2 | import "@testing-library/jest-dom"; |
3 | 3 | import { screen, waitFor, within } from "@testing-library/react"; |
4 | | -import userEvent, { UserEvent } from "@testing-library/user-event"; |
| 4 | +import userEvent from "@testing-library/user-event"; |
5 | 5 | import { CLIMB } from "@core/__mocks__/events/events.misc"; |
6 | 6 | import { render } from "@web/__tests__/__mocks__/mock.render"; |
7 | 7 | import { preloadedState } from "@web/__tests__/__mocks__/state/state.weekEvents"; |
@@ -67,53 +67,3 @@ describe("Event Form", () => { |
67 | 67 | }); |
68 | 68 | }); |
69 | 69 | }); |
70 | | - |
71 | | -/*********** |
72 | | - * Helpers * |
73 | | - ***********/ |
74 | | -const _clickHeading = async (user: UserEvent) => { |
75 | | - await user.click(screen.getByRole("heading", { level: 1 })); |
76 | | -}; |
77 | | - |
78 | | -const _confirmCorrectEventFormIsOpen = async (eventName: string) => { |
79 | | - await waitFor(() => { |
80 | | - expect( |
81 | | - within(screen.getByRole("form")).getByText(eventName), |
82 | | - ).toBeInTheDocument(); |
83 | | - }); |
84 | | -}; |
85 | | -// it("opens when clicking events", async () => { |
86 | | -// const user = userEvent.setup(); |
87 | | -// render(<CalendarView />, { state: preloadedState }); |
88 | | -// expect(screen.queryByRole("form")).not.toBeInTheDocument(); |
89 | | -/* timed event */ |
90 | | -// await act(async () => { |
91 | | -// await user.click(screen.getByRole("button", { name: /Ty & Tim/i })); |
92 | | -// await _confirmCorrectEventFormIsOpen(TY_TIM.title); |
93 | | -// }); |
94 | | -/* multi-week event */ |
95 | | -// await act(async () => { |
96 | | -// await _clickHeading(user); |
97 | | -// await user.click( |
98 | | -// screen.getByRole("button", { name: /multiweek event/i }) |
99 | | -// ); |
100 | | -// }); |
101 | | -// await waitFor( |
102 | | -// () => { |
103 | | -// expect(screen.getByRole("form")).toBeInTheDocument(); |
104 | | -// }, |
105 | | -// { timeout: 10000 } |
106 | | -// ); |
107 | | -// await _confirmCorrectEventFormIsOpen(MULTI_WEEK.title); |
108 | | -// await waitFor(() => { |
109 | | -// expect( |
110 | | -// within(screen.getByRole("form")).getByText(MULTI_WEEK.title) |
111 | | -// ).toBeInTheDocument(); |
112 | | -// }); |
113 | | -// /* someday event */ |
114 | | -// await _clickHeading(user); |
115 | | -// await user.click(screen.getByRole("button", { name: /takeover world/i })); |
116 | | -// expect( |
117 | | -// within(screen.getRole("form", name: {"Someday Event Form"})).getByText("Takeover world") |
118 | | -// ).toBeInTheDocument(); |
119 | | -// }, 20000); |
0 commit comments