"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
/**
 * @jest-environment jsdom
 */
const react_1 = require("@testing-library/react");
const useFeature_1 = __importDefault(require("./useFeature"));
const mock_1 = require("./mock");
describe("useFeature hook", () => {
    it("should return null if a flag is not defined remotely", () => {
        const mockedFeatures = {};
        const { result } = (0, react_1.renderHook)(() => (0, useFeature_1.default)("mockFeature"), {
            wrapper: (0, mock_1.makeMockedFeatureFlagsProviderWrapper)((0, mock_1.makeMockedContextValue)(mockedFeatures)),
        });
        expect(result.current).toBeNull();
    });
    it("should return the feature flag value if the feature flag is defined", () => {
        const mockedFeatures = {
            mockFeature: { enabled: true, params: { blabla: "hello" } },
        };
        const { result } = (0, react_1.renderHook)(() => (0, useFeature_1.default)("mockFeature"), {
            wrapper: (0, mock_1.makeMockedFeatureFlagsProviderWrapper)((0, mock_1.makeMockedContextValue)(mockedFeatures)),
        });
        expect(result.current).toBe(mockedFeatures.mockFeature);
    });
});
//# sourceMappingURL=useFeature.test.js.map