mirror of
https://github.com/oxynote/oxynote.git
synced 2026-10-18 19:35:59 +02:00
16 lines
475 B
TypeScript
16 lines
475 B
TypeScript
import { describe, it } from "vitest"
|
|
import { sanitizeSearchResult } from "./sanitize"
|
|
|
|
describe("sanitizeSearchResult", () => {
|
|
it("returns an empty string for empty input", ({ expect }) => {
|
|
expect(sanitizeSearchResult("")).toBe("")
|
|
})
|
|
|
|
// node has no window, so this exercises the server-side fallback
|
|
it("strips every tag on the server side", ({ expect }) => {
|
|
expect(sanitizeSearchResult("<b>bold</b> and <mark>hit</mark>")).toBe(
|
|
"bold and hit",
|
|
)
|
|
})
|
|
})
|