backend/test/utils/newSanitizer.utils.test.ts

10 lines
330 B
TypeScript
Raw Normal View History

import { removeNewlineAndPTag } from "../../src/utils/newSanitizer";
describe("newSanitizer", () => {
test("Should remove /\n and <p>/</p> elements", () => {
const input = "\n<p>This is a string</p>";
const expectedOutput = "This is a string";
expect(removeNewlineAndPTag(input)).toEqual(expectedOutput);
});
});