pon-shared-pon.universe.frontend.shared.componentlibrary
Version:
shared components for Pon Universe
18 lines (14 loc) • 613 B
JavaScript
import htmlEncode from "./pu-helper-html-encode";
describe("pu-helper-html-encode", () => {
it("returns false if the parameter is not a string", () => {
expect(htmlEncode({})).toBe(false);
expect(htmlEncode([])).toBe(false);
expect(htmlEncode(23)).toBe(false);
});
it("returns an empty string if the parameter is an empty string", () => {
expect(htmlEncode("")).toBe("");
});
it('translates a given string to charcodes, with each charcode being prefixed by "&#" and suffixed by ";"', () => {
expect(htmlEncode("test")).toBe("test");
});
});