@ledgerhq/live-common
Version:
Common ground for the Ledger Live apps
16 lines • 715 B
JavaScript
/**
* @jest-environment jsdom
*/
import { renderHook } from "@testing-library/react";
import { makeMockedContextValue, makeMockedFeatureFlagsProviderWrapper } from "./mock";
import { useFeatureFlags } from "./FeatureFlagsContext";
describe("useFeatureFlags hook", () => {
it("should return the context value if it is used inside a context provider", () => {
const mockedContextValue = makeMockedContextValue({});
const { result } = renderHook(() => useFeatureFlags(), {
wrapper: makeMockedFeatureFlagsProviderWrapper(mockedContextValue),
});
expect(result?.current).toStrictEqual(mockedContextValue);
});
});
//# sourceMappingURL=FeatureFlagsContext.test.js.map