import { openBottomSheetModal } from "@applicaster/zapp-react-native-utils/modalState"; import { boundActionButton } from "../boundActionButton"; import { openActionsBottomSheet } from "../openActionsBottomSheet"; jest.mock("@applicaster/zapp-react-native-utils/modalState", () => ({ openBottomSheetModal: jest.fn(), })); jest.mock("../boundActionButton", () => ({ boundActionButton: jest.fn(() => jest.fn()), })); describe("openActionsBottomSheet", () => { beforeEach(() => { jest.clearAllMocks(); }); it("binds the List component into the sheet row button", () => { const entry = { id: "entry-1" } as ZappEntry; const component = { data: { source: "https://example.com/user/collections/abc" }, }; const actions = [ { identifier: "entry_action_0", action: { invokeAction: jest.fn() } }, ]; openActionsBottomSheet({ entry, actions: actions as any, component: component as any, }); expect(boundActionButton).toHaveBeenCalledWith(entry, component); expect(openBottomSheetModal).toHaveBeenCalledTimes(1); }); });