backend/test/utils/sanitizer.utils.test.ts
Fred Boniface 0e748d545e Begin adding tests for sanitizer
Signed-off-by: Fred Boniface <fred@fjla.uk>
2023-08-01 21:49:00 +01:00

9 lines
328 B
TypeScript

import { removeNewlineAndPTag } from "../../src/utils/sanitizer.utils";
describe('sanitizer', () => {
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);
});
});