Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
olerichter00 committed Oct 14, 2024
1 parent 17ea2b2 commit 9f86cbb
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/app/Components/Swipeable/Swipeable.tests.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
import { Text } from "@artsy/palette-mobile"
import { screen, fireEvent } from "@testing-library/react-native"
import { fireEvent, screen } from "@testing-library/react-native"
import { Swipeable } from "app/Components/Swipeable/Swipeable"
import { renderWithWrappers } from "app/utils/tests/renderWithWrappers"

describe("Swipeable Component", () => {
const mockAction = jest.fn()

it("should render without crashing", () => {
renderWithWrappers(<Swipeable {...mockProps} actionOnPress={mockAction} />)
renderWithWrappers(
<Swipeable {...mockProps} actionComponentWidth={80} actionOnPress={mockAction} />
)

expect(screen.getByTestId("swipeable-component")).toBeOnTheScreen()
})

it("should call the action when the action component is pressed", () => {
renderWithWrappers(<Swipeable {...mockProps} actionOnPress={mockAction} />)
renderWithWrappers(
<Swipeable {...mockProps} actionComponentWidth={80} actionOnPress={mockAction} />
)

fireEvent.press(screen.getByText("Swipe Me"))

Expand Down

0 comments on commit 9f86cbb

Please sign in to comment.