import { escapeForHtml } from "../utils"; describe("Utils", function() { describe("escape", function() { it("should escape & with &", function() { const result = escapeForHtml("&"); expect("&").toEqual(result); }); it("should escape < with <", function() { const result = escapeForHtml("<"); expect("<").toEqual(result); }); it("should escape > with >", function() { const result = escapeForHtml(">"); expect(">").toEqual(result); }); it("should escape a string with multiple problematic characters", function() { const result = escapeForHtml('\tlink text'); const expected = "<a href="#">\tlink text</a>"; expect(expected).toEqual(result); }); }); });