From d0009af3323e636ff81f70f0197ea8f5e1857a62 Mon Sep 17 00:00:00 2001 From: sieu-db Date: Wed, 4 Dec 2024 21:25:25 +0700 Subject: [PATCH] update jest --- packages/core/jest-setup.js | 6 ++++++ packages/core/src/components/Button.tsx | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/core/jest-setup.js b/packages/core/jest-setup.js index 7d8190595..f3b1ff4fa 100644 --- a/packages/core/jest-setup.js +++ b/packages/core/jest-setup.js @@ -25,3 +25,9 @@ jest.mock("expo-asset", () => { jest.mock("@react-native-async-storage/async-storage", () => require("@react-native-async-storage/async-storage/jest/async-storage-mock") ); + +jest.mock("expo-font", () => ({ + loadAsync: jest.fn(), + isLoaded: jest.fn(() => true), + isLoading: jest.fn(() => false), +})); diff --git a/packages/core/src/components/Button.tsx b/packages/core/src/components/Button.tsx index 91314f15a..3e00bcfb6 100644 --- a/packages/core/src/components/Button.tsx +++ b/packages/core/src/components/Button.tsx @@ -8,6 +8,7 @@ import { TextStyle, ActivityIndicator, ViewStyle, + StyleProp, } from "react-native"; import { withTheme } from "@draftbit/theme"; import type { ReadTheme } from "@draftbit/theme"; @@ -112,7 +113,7 @@ function Base({ { opacity: pressed ? activeOpacity : disabled ? disabledOpacity : 1, }, - buttonStyles as ViewStyle, + buttonStyles as StyleProp, ]; }} {...props} @@ -151,7 +152,7 @@ const Solid = ({ style, theme, ...props }: Props): JSX.Element => { borderRadius: 8, backgroundColor: theme.colors.branding.primary, }, - style as ViewStyle, + style as StyleProp, ]} {...props} /> @@ -178,7 +179,7 @@ const Outline = ({ style, theme, ...props }: Props): JSX.Element => { //@ts-ignore color: theme.colors.branding.primary, }, - style as ViewStyle, + style as StyleProp, ]} {...props} />