"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const booleanConverter_1 = require("./booleanConverter");
describe('convertToBooleanValue', () => {
    describe('Native boolean values', () => {
        it('should return true for boolean true', () => {
            expect((0, booleanConverter_1.convertToBooleanValue)(true)).toBe(true);
        });
        it('should return false for boolean false', () => {
            expect((0, booleanConverter_1.convertToBooleanValue)(false)).toBe(false);
        });
    });
    describe('String boolean representations', () => {
        it('should return false for string "false"', () => {
            expect((0, booleanConverter_1.convertToBooleanValue)('false')).toBe(false);
        });
        it('should return true for string "true"', () => {
            expect((0, booleanConverter_1.convertToBooleanValue)('true')).toBe(true);
        });
        it('should handle case insensitive strings', () => {
            expect((0, booleanConverter_1.convertToBooleanValue)('FALSE')).toBe(false);
            expect((0, booleanConverter_1.convertToBooleanValue)('TRUE')).toBe(true);
            expect((0, booleanConverter_1.convertToBooleanValue)('False')).toBe(false);
            expect((0, booleanConverter_1.convertToBooleanValue)('True')).toBe(true);
        });
        it('should handle whitespace around boolean strings', () => {
            expect((0, booleanConverter_1.convertToBooleanValue)(' false ')).toBe(false);
            expect((0, booleanConverter_1.convertToBooleanValue)(' true ')).toBe(true);
            expect((0, booleanConverter_1.convertToBooleanValue)('\tfalse\t')).toBe(false);
            expect((0, booleanConverter_1.convertToBooleanValue)('\ttrue\t')).toBe(true);
        });
    });
    describe('Fallback behavior for non-boolean types', () => {
        it('should use !! conversion for non-boolean strings', () => {
            expect((0, booleanConverter_1.convertToBooleanValue)('hello')).toBe(true);
            expect((0, booleanConverter_1.convertToBooleanValue)('')).toBe(false);
            expect((0, booleanConverter_1.convertToBooleanValue)('0')).toBe(true);
            expect((0, booleanConverter_1.convertToBooleanValue)('1')).toBe(true);
        });
        it('should use !! conversion for numbers', () => {
            expect((0, booleanConverter_1.convertToBooleanValue)(0)).toBe(false);
            expect((0, booleanConverter_1.convertToBooleanValue)(1)).toBe(true);
            expect((0, booleanConverter_1.convertToBooleanValue)(-1)).toBe(true);
        });
        it('should use !! conversion for objects', () => {
            expect((0, booleanConverter_1.convertToBooleanValue)({})).toBe(true);
            expect((0, booleanConverter_1.convertToBooleanValue)([])).toBe(true);
            expect((0, booleanConverter_1.convertToBooleanValue)(null)).toBe(false);
            expect((0, booleanConverter_1.convertToBooleanValue)(undefined)).toBe(false);
        });
    });
    describe('Edge cases', () => {
        it('should handle empty string', () => {
            expect((0, booleanConverter_1.convertToBooleanValue)('')).toBe(false);
        });
        it('should handle whitespace-only strings', () => {
            expect((0, booleanConverter_1.convertToBooleanValue)('   ')).toBe(true); // Non-empty string, so truthy
        });
    });
});
//# sourceMappingURL=booleanConverter.test.js.map