Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

util.test.ts

15 lines522 Bytes

1import { expect, it, vi } from "vite-plus/test";
2​
3import { flattenStyles } from "./util";
4​
5vi.mock("react-native", () => ({
6 I18nManager: { isRTL: false },
7 StyleSheet: {
8 flatten: (styles: ReadonlyArray<object | undefined>) => Object.assign({}, ...styles),
9 },
10}));
11​
12it("encodes numeric bold weights as bold source-text runs", () => {
13 expect(flattenStyles({ fontWeight: 700 }, undefined).fontWeight).toBe("bold");
14 expect(flattenStyles({ fontWeight: "400" }, { fontWeight: "700" }).fontWeight).toBe("bold");
15});