"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const react_1 = require("@testing-library/react");
const useAllPostOnboardingActionsCompleted_1 = require("./useAllPostOnboardingActionsCompleted");
const mock_1 = require("../mock");
const usePostOnboardingHubState_1 = require("./usePostOnboardingHubState");
jest.mock("./usePostOnboardingHubState");
jest.mock("react-redux", () => ({}));
const mockedUsePostOnboardingHubState = jest.mocked(usePostOnboardingHubState_1.usePostOnboardingHubState);
const mockedStateNoActions = {
    deviceModelId: null,
    lastActionCompleted: null,
    actionsState: [],
    postOnboardingInProgress: false,
};
const mockedStateAllActionsCompleted = {
    deviceModelId: null,
    lastActionCompleted: null,
    actionsState: [
        { ...mock_1.claimTestMock, completed: true },
        { ...mock_1.personalizeTestMock, completed: true },
        { ...mock_1.migrateAssetsTestMock, completed: true },
    ],
    postOnboardingInProgress: false,
};
const mockedStateNoActionsCompleted = {
    deviceModelId: null,
    lastActionCompleted: null,
    actionsState: [
        { ...mock_1.claimTestMock, completed: false },
        { ...mock_1.personalizeTestMock, completed: false },
        { ...mock_1.migrateAssetsTestMock, completed: false },
    ],
    postOnboardingInProgress: false,
};
const mockedStateSomeActionsCompleted = {
    deviceModelId: null,
    lastActionCompleted: null,
    actionsState: [
        { ...mock_1.claimTestMock, completed: false },
        { ...mock_1.personalizeTestMock, completed: true },
        { ...mock_1.migrateAssetsTestMock, completed: false },
    ],
    postOnboardingInProgress: false,
};
describe("useAllPostOnboardingActionsCompleted", () => {
    it("should return true if no actions are present", () => {
        mockedUsePostOnboardingHubState.mockReturnValue(mockedStateNoActions);
        const { result } = (0, react_1.renderHook)(() => (0, useAllPostOnboardingActionsCompleted_1.useAllPostOnboardingActionsCompleted)());
        expect(result.current).toBe(true);
    });
    it("should return true if all actions are completed", () => {
        mockedUsePostOnboardingHubState.mockReturnValue(mockedStateAllActionsCompleted);
        const { result } = (0, react_1.renderHook)(() => (0, useAllPostOnboardingActionsCompleted_1.useAllPostOnboardingActionsCompleted)());
        expect(result.current).toBe(true);
    });
    it("should return false if some actions are completed", () => {
        mockedUsePostOnboardingHubState.mockReturnValue(mockedStateSomeActionsCompleted);
        const { result } = (0, react_1.renderHook)(() => (0, useAllPostOnboardingActionsCompleted_1.useAllPostOnboardingActionsCompleted)());
        expect(result.current).toBe(false);
    });
    it("should return false if no actions are completed", () => {
        mockedUsePostOnboardingHubState.mockReturnValue(mockedStateNoActionsCompleted);
        const { result } = (0, react_1.renderHook)(() => (0, useAllPostOnboardingActionsCompleted_1.useAllPostOnboardingActionsCompleted)());
        expect(result.current).toBe(false);
    });
});
//# sourceMappingURL=useAllPostOnboardingActionsCompleted.test.js.map