git.iko.soy/rowtype-yoga/purescript-yoga-react-native
on v0.1.0 help sign in
17 lines 587 B history raw
1import { describe, it, expect } from "vitest";
2import { showActionSheetImpl, dismissActionSheet } from "../src/Yoga/React/Native/ActionSheetIOS.js";
4describe("ActionSheetIOS FFI", () => {
5 it("showActionSheetImpl calls the callback", () => {
6 let selectedIndex;
7 showActionSheetImpl(
8 { options: ["Cancel", "Delete"], cancelButtonIndex: 0, destructiveButtonIndex: 1 },
9 (index) => { selectedIndex = index; }
10 );
11 expect(selectedIndex).toBe(0);
12 });
14 it("dismissActionSheet is an effect", () => {
15 expect(() => dismissActionSheet()).not.toThrow();
16 });
17});