git.iko.soy/rowtype-yoga/purescript-yoga-react-native
on v0.1.0 help sign in
216 lines 7.8 kB history raw
1import { describe, it, expect } from "vitest";
3// Batch 1 — existing macOS native components
4import { buttonImpl } from "../src/Yoga/React/Native/MacOS/Button.js";
5import { segmentedImpl } from "../src/Yoga/React/Native/MacOS/Segmented.js";
6import { textFieldImpl } from "../src/Yoga/React/Native/MacOS/TextField.js";
7import { sliderImpl } from "../src/Yoga/React/Native/MacOS/Slider.js";
8import { switchImpl } from "../src/Yoga/React/Native/MacOS/Switch.js";
9import { progressImpl } from "../src/Yoga/React/Native/MacOS/Progress.js";
10import { datePickerImpl } from "../src/Yoga/React/Native/MacOS/DatePicker.js";
11import { colorWellImpl } from "../src/Yoga/React/Native/MacOS/ColorWell.js";
12import { popUpImpl } from "../src/Yoga/React/Native/MacOS/PopUp.js";
13import { textEditorImpl } from "../src/Yoga/React/Native/MacOS/TextEditor.js";
14import { webViewImpl } from "../src/Yoga/React/Native/MacOS/WebView.js";
15import { levelIndicatorImpl } from "../src/Yoga/React/Native/MacOS/LevelIndicator.js";
16import { nativeScrollViewImpl } from "../src/Yoga/React/Native/MacOS/ScrollView.js";
17import { visualEffectImpl } from "../src/Yoga/React/Native/MacOS/VisualEffect.js";
18import { contextMenuImpl } from "../src/Yoga/React/Native/MacOS/ContextMenu.js";
19import { filePickerImpl } from "../src/Yoga/React/Native/MacOS/FilePicker.js";
20import { videoPlayerImpl } from "../src/Yoga/React/Native/MacOS/VideoPlayer.js";
21import { animatedImageImpl } from "../src/Yoga/React/Native/MacOS/AnimatedImage.js";
22import { patternBackgroundImpl } from "../src/Yoga/React/Native/MacOS/PatternBackground.js";
23import { splitViewImpl } from "../src/Yoga/React/Native/MacOS/SplitView.js";
24import { tabViewImpl } from "../src/Yoga/React/Native/MacOS/TabView.js";
25import { comboBoxImpl } from "../src/Yoga/React/Native/MacOS/ComboBox.js";
26import { stepperImpl } from "../src/Yoga/React/Native/MacOS/Stepper.js";
27import { boxImpl } from "../src/Yoga/React/Native/MacOS/Box.js";
28import { popoverImpl } from "../src/Yoga/React/Native/MacOS/Popover.js";
29import { imageImpl } from "../src/Yoga/React/Native/MacOS/Image.js";
31// Batch 2 — new macOS native components
32import { checkboxImpl } from "../src/Yoga/React/Native/MacOS/Checkbox.js";
33import { radioButtonImpl } from "../src/Yoga/React/Native/MacOS/RadioButton.js";
34import { searchFieldImpl } from "../src/Yoga/React/Native/MacOS/SearchField.js";
35import { tokenFieldImpl } from "../src/Yoga/React/Native/MacOS/TokenField.js";
36import { separatorImpl } from "../src/Yoga/React/Native/MacOS/Separator.js";
37import { helpButtonImpl } from "../src/Yoga/React/Native/MacOS/HelpButton.js";
38import { pathControlImpl } from "../src/Yoga/React/Native/MacOS/PathControl.js";
39import { sheetImpl } from "../src/Yoga/React/Native/MacOS/Sheet.js";
40import { tableViewImpl } from "../src/Yoga/React/Native/MacOS/TableView.js";
42describe("macOS native component FFI exports (batch 1)", () => {
43 it("Button resolves to NativeButton", () => {
44 expect(buttonImpl).toBe("NativeButton");
45 });
47 it("Segmented resolves to NativeSegmented", () => {
48 expect(segmentedImpl).toBe("NativeSegmented");
49 });
51 it("TextField resolves to NativeTextField", () => {
52 expect(textFieldImpl).toBe("NativeTextField");
53 });
55 it("Slider resolves to NativeSlider", () => {
56 expect(sliderImpl).toBe("NativeSlider");
57 });
59 it("Switch resolves to NativeSwitch", () => {
60 expect(switchImpl).toBe("NativeSwitch");
61 });
63 it("Progress resolves to NativeProgress", () => {
64 expect(progressImpl).toBe("NativeProgress");
65 });
67 it("DatePicker resolves to NativeDatePicker", () => {
68 expect(datePickerImpl).toBe("NativeDatePicker");
69 });
71 it("ColorWell resolves to NativeColorWell", () => {
72 expect(colorWellImpl).toBe("NativeColorWell");
73 });
75 it("PopUp resolves to NativePopUp", () => {
76 expect(popUpImpl).toBe("NativePopUp");
77 });
79 it("TextEditor resolves to NativeTextEditor", () => {
80 expect(textEditorImpl).toBe("NativeTextEditor");
81 });
83 it("WebView resolves to NativeWebView", () => {
84 expect(webViewImpl).toBe("NativeWebView");
85 });
87 it("LevelIndicator resolves to NativeLevelIndicator", () => {
88 expect(levelIndicatorImpl).toBe("NativeLevelIndicator");
89 });
91 it("ScrollView resolves to MacOSScrollView", () => {
92 expect(nativeScrollViewImpl).toBe("MacOSScrollView");
93 });
95 it("VisualEffect resolves to MacOSVisualEffectView", () => {
96 expect(visualEffectImpl).toBe("MacOSVisualEffectView");
97 });
99 it("ContextMenu resolves to MacOSContextMenu", () => {
100 expect(contextMenuImpl).toBe("MacOSContextMenu");
101 });
103 it("FilePicker resolves to MacOSFilePicker", () => {
104 expect(filePickerImpl).toBe("MacOSFilePicker");
105 });
107 it("VideoPlayer resolves to MacOSVideoPlayer", () => {
108 expect(videoPlayerImpl).toBe("MacOSVideoPlayer");
109 });
111 it("AnimatedImage resolves to MacOSAnimatedImage", () => {
112 expect(animatedImageImpl).toBe("MacOSAnimatedImage");
113 });
115 it("PatternBackground resolves to MacOSPatternBackground", () => {
116 expect(patternBackgroundImpl).toBe("MacOSPatternBackground");
117 });
119 it("SplitView resolves to MacOSSplitView", () => {
120 expect(splitViewImpl).toBe("MacOSSplitView");
121 });
123 it("TabView resolves to MacOSTabView", () => {
124 expect(tabViewImpl).toBe("MacOSTabView");
125 });
127 it("ComboBox resolves to MacOSComboBox", () => {
128 expect(comboBoxImpl).toBe("MacOSComboBox");
129 });
131 it("Stepper resolves to MacOSStepper", () => {
132 expect(stepperImpl).toBe("MacOSStepper");
133 });
135 it("Box resolves to MacOSBox", () => {
136 expect(boxImpl).toBe("MacOSBox");
137 });
139 it("Popover resolves to MacOSPopover", () => {
140 expect(popoverImpl).toBe("MacOSPopover");
141 });
143 it("Image resolves to MacOSImage", () => {
144 expect(imageImpl).toBe("MacOSImage");
145 });
146});
148describe("macOS native component FFI exports (batch 2)", () => {
149 it("Checkbox resolves to MacOSCheckbox", () => {
150 expect(checkboxImpl).toBe("MacOSCheckbox");
151 });
153 it("RadioButton resolves to MacOSRadioButton", () => {
154 expect(radioButtonImpl).toBe("MacOSRadioButton");
155 });
157 it("SearchField resolves to MacOSSearchField", () => {
158 expect(searchFieldImpl).toBe("MacOSSearchField");
159 });
161 it("TokenField resolves to MacOSTokenField", () => {
162 expect(tokenFieldImpl).toBe("MacOSTokenField");
163 });
165 it("Separator resolves to MacOSSeparator", () => {
166 expect(separatorImpl).toBe("MacOSSeparator");
167 });
169 it("HelpButton resolves to MacOSHelpButton", () => {
170 expect(helpButtonImpl).toBe("MacOSHelpButton");
171 });
173 it("PathControl resolves to MacOSPathControl", () => {
174 expect(pathControlImpl).toBe("MacOSPathControl");
175 });
177 it("Sheet resolves to MacOSSheet", () => {
178 expect(sheetImpl).toBe("MacOSSheet");
179 });
181 it("TableView resolves to MacOSTableView", () => {
182 expect(tableViewImpl).toBe("MacOSTableView");
183 });
184});
186// Batch 3
187import { outlineViewImpl } from "../src/Yoga/React/Native/MacOS/OutlineView.js";
189describe("macOS native component FFI exports (batch 3)", () => {
190 it("OutlineView resolves to MacOSOutlineView", () => {
191 expect(outlineViewImpl).toBe("MacOSOutlineView");
192 });
193});
195// Batch 4
196import { mapViewImpl } from "../src/Yoga/React/Native/MacOS/MapView.js";
197import { pdfViewImpl } from "../src/Yoga/React/Native/MacOS/PDFView.js";
199describe("macOS native component FFI exports (batch 4)", () => {
200 it("MapView resolves to MacOSMapView", () => {
201 expect(mapViewImpl).toBe("MacOSMapView");
202 });
204 it("PDFView resolves to MacOSPDFView", () => {
205 expect(pdfViewImpl).toBe("MacOSPDFView");
206 });
207});
209// Batch 5
210import { cameraViewImpl } from "../src/Yoga/React/Native/MacOS/CameraView.js";
212describe("macOS native component FFI exports (batch 5)", () => {
213 it("CameraView resolves to MacOSCameraView", () => {
214 expect(cameraViewImpl).toBe("MacOSCameraView");
215 });
216});