git.iko.soy/rowtype-yoga/purescript-yoga-react-native
on v0.2.1 help sign in
19 lines 695 B history raw
1import { describe, it, expect } from "vitest";
2import { stylesImpl, tw } from "../src/Yoga/React/Native/Style.js";
4describe("Style FFI", () => {
5 it("stylesImpl merges an array of style objects", () => {
6 const result = stylesImpl([{ flex: 1 }, { color: "red" }, { padding: 10 }]);
7 expect(result).toEqual({ flex: 1, color: "red", padding: 10 });
8 });
10 it("stylesImpl later values override earlier", () => {
11 const result = stylesImpl([{ color: "red" }, { color: "blue" }]);
12 expect(result.color).toBe("blue");
13 });
15 it("tw returns a style object from a class string", () => {
16 const result = tw("flex-1 p-4");
17 expect(result).toEqual({ _tw: "flex-1 p-4" });
18 });
19});