"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
 * @jest-environment jsdom
 */
const react_1 = require("@testing-library/react");
const reducer_1 = require("../reducer");
const useAllPostOnboardingActionsCompleted_1 = require("./useAllPostOnboardingActionsCompleted");
const usePostOnboardingEntryPointVisibleOnWallet_1 = require("./usePostOnboardingEntryPointVisibleOnWallet");
const types_devices_1 = require("@ledgerhq/types-devices");
jest.mock("react-redux", () => ({
    useSelector: fun => fun(),
}));
jest.mock("../reducer");
jest.mock("./useAllPostOnboardingActionsCompleted");
const mockedUseAllCompleted = jest.mocked(useAllPostOnboardingActionsCompleted_1.useAllPostOnboardingActionsCompleted);
const mockedDismissedSelector = jest.mocked(reducer_1.walletPostOnboardingEntryPointDismissedSelector);
const mockedDeviceModelIdSelector = jest.mocked(reducer_1.postOnboardingDeviceModelIdSelector);
describe("usePostOnboardingEntryPointVisibleOnWallet", () => {
    beforeEach(() => {
        mockedUseAllCompleted.mockClear();
        mockedDismissedSelector.mockClear();
        mockedDeviceModelIdSelector.mockClear();
    });
    it("should be false if deviceModelId is null", () => {
        mockedUseAllCompleted.mockReturnValue(false);
        mockedDismissedSelector.mockReturnValue(false);
        mockedDeviceModelIdSelector.mockReturnValue(null);
        const { result } = (0, react_1.renderHook)(() => (0, usePostOnboardingEntryPointVisibleOnWallet_1.usePostOnboardingEntryPointVisibleOnWallet)());
        expect(result.current).toBe(false);
    });
    it("should be false if the the entry point HAS been dismissed", () => {
        mockedDismissedSelector.mockReturnValue(true);
        mockedDeviceModelIdSelector.mockReturnValue(types_devices_1.DeviceModelId.nanoX);
        mockedUseAllCompleted.mockReturnValue(false);
        const { result: res1 } = (0, react_1.renderHook)(() => (0, usePostOnboardingEntryPointVisibleOnWallet_1.usePostOnboardingEntryPointVisibleOnWallet)());
        expect(res1.current).toBe(false);
        mockedUseAllCompleted.mockReturnValue(true);
        const { result: res2 } = (0, react_1.renderHook)(() => (0, usePostOnboardingEntryPointVisibleOnWallet_1.usePostOnboardingEntryPointVisibleOnWallet)());
        expect(res2.current).toBe(false);
    });
    it("should be false if all actions are completed", () => {
        mockedDismissedSelector.mockReturnValue(false);
        mockedUseAllCompleted.mockReturnValue(true);
        mockedDeviceModelIdSelector.mockReturnValue(types_devices_1.DeviceModelId.nanoX);
        const { result } = (0, react_1.renderHook)(() => (0, usePostOnboardingEntryPointVisibleOnWallet_1.usePostOnboardingEntryPointVisibleOnWallet)());
        expect(result.current).toBe(false);
    });
    it("should be true if the entry point HAS NOT been dismissed and all actions are NOT completed", () => {
        mockedDismissedSelector.mockReturnValue(false);
        mockedUseAllCompleted.mockReturnValue(false);
        mockedDeviceModelIdSelector.mockReturnValue(types_devices_1.DeviceModelId.nanoX);
        const { result } = (0, react_1.renderHook)(() => (0, usePostOnboardingEntryPointVisibleOnWallet_1.usePostOnboardingEntryPointVisibleOnWallet)());
        expect(result.current).toBe(true);
    });
});
//# sourceMappingURL=usePostOnboardingEntryPointVisibleOnWallet.test.js.map