Skip to content

test : added vitest unit tests for sanitizeHtml utility#1894

Open
tmdeveloper007 wants to merge 1 commit into
gopaljilab:mainfrom
tmdeveloper007:#1889
Open

test : added vitest unit tests for sanitizeHtml utility#1894
tmdeveloper007 wants to merge 1 commit into
gopaljilab:mainfrom
tmdeveloper007:#1889

Conversation

@tmdeveloper007

Copy link
Copy Markdown
Contributor

Closes #1889.

Summary of What Has Been Done:
Added vitest unit tests for sanitizeHtml in server/utils/sanitize.ts. This function strips HTML tags from strings using a regex replace. Note: sanitizeCsvCell and escapeCsvCell are defined in a separate file (server/utils/csvSanitizer.ts).

Changes Made:

  • server/utils/sanitize.test.ts (new file, 11 test cases)
    • HTML tag stripping, script tag removal, nested tags, attributes, self-closing tags, malformed input, plain-text preservation

Impact it Made:

  • 11 new passing tests on the server project

Note: Please assign this PR to the tmdeveloper007 account.

Cover HTML tag stripping, script tags, nested tags,
attributes, self-closing tags, malformed input, and
plain-text preservation. 11 passing tests.
@vercel

vercel Bot commented Jun 25, 2026

Copy link
Copy Markdown

@tmdeveloper007 is attempting to deploy a commit to the gopaljilab's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added the type:testing Adding, updating, or fixing unit/integration tests. label Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:testing Adding, updating, or fixing unit/integration tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test : add vitest unit tests for sanitize utility

1 participant