/* eslint-disable @typescript-eslint/no-unused-vars */ import type { PropsWithChildren } from "react"; import React from "react"; import { renderHook } from "@testing-library/react-native"; import type { AtlantisContextProps } from "./AtlantisContext"; import { AtlantisContext, atlantisContextDefaultValues, useAtlantisContext, } from "./AtlantisContext"; const providerValues: AtlantisContextProps = { dateFormat: "MM/DD/YYYY", timeFormat: "hh:mm a", timeZone: "America/Edmonton", locale: "en", isOnline: false, onLogError: _ => { return; }, floatSeparators: { decimal: ".", group: "," }, currencySymbol: "€", headerHeight: 50, setHeaderHeight: _ => { return; }, }; describe("AtlantisContext", () => { describe("No Provider", () => { it("should get the default values", () => { const { result } = renderHook(() => useAtlantisContext()); expect(result.current).toMatchObject(atlantisContextDefaultValues); }); }); describe("With Provider", () => { it("should get the provider values", () => { const { result } = renderHook(() => useAtlantisContext(), { wrapper: ({ children }: PropsWithChildren) => ( {children} ), }); expect(result.current).toMatchObject(providerValues); }); }); });