"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("./utils");
describe('escapeAttribute', () => {
    it('should escape double quotes', () => {
        expect((0, utils_1.escapeAttribute)('"hello"')).toBe('&quot;hello&quot;');
    });
    it('should escape single quotes', () => {
        expect((0, utils_1.escapeAttribute)("'hello'")).toBe('&apos;hello&apos;');
    });
    it('should escape ampersand', () => {
        expect((0, utils_1.escapeAttribute)('a&b')).toBe('a&amp;b');
    });
    it('should escape less-than and greater-than', () => {
        expect((0, utils_1.escapeAttribute)('<script>')).toBe('&lt;script&gt;');
    });
    it('should handle mixed dangerous characters', () => {
        expect((0, utils_1.escapeAttribute)('"\'&<>')).toBe('&quot;&apos;&amp;&lt;&gt;');
    });
    it('should not escape safe characters', () => {
        expect((0, utils_1.escapeAttribute)('abc123')).toBe('abc123');
        expect((0, utils_1.escapeAttribute)('привет')).toBe('привет');
        expect((0, utils_1.escapeAttribute)('😊')).toBe('😊');
    });
    it('should handle empty string', () => {
        expect((0, utils_1.escapeAttribute)('')).toBe('');
    });
    it('should handle already escaped entities', () => {
        expect((0, utils_1.escapeAttribute)('&quot;')).toBe('&amp;quot;');
        expect((0, utils_1.escapeAttribute)('&amp;')).toBe('&amp;amp;');
    });
});
