Код: Выделить всё
beforeEach(() => {
useStore.setState(useStore.getInitialState(), true)
})
it("does something", () => {
renderComponent()
expect(screen.getByLabelText(/Event Type/i)).toBeInTheDocument()
expect(screen.getByLabelText(/Appointment Status/i)).toBeInTheDocument()
})
it("does something else", () => {
useStore.setState({ currentScheduleItem: null })
renderComponent()
expect(screen.getByText("Consultation")).toBeInTheDocument()
expect(screen.queryByText("Surgery")).not.toBeInTheDocument()
})
Все, что я могу попробовать?
Подробнее здесь: https://stackoverflow.com/questions/797 ... ween-tests
Мобильная версия