mirror of
https://github.com/saltbo/zpan.git
synced 2026-10-31 11:12:45 +08:00
13 lines
429 B
TypeScript
13 lines
429 B
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import { escapeHtml } from './html'
|
|
|
|
describe('escapeHtml', () => {
|
|
it('escapes every HTML-significant character', () => {
|
|
expect(escapeHtml(`<a href="x&y">'link'</a>`)).toBe('<a href="x&y">'link'</a>')
|
|
})
|
|
|
|
it('leaves plain text unchanged', () => {
|
|
expect(escapeHtml('Alice shared report.pdf')).toBe('Alice shared report.pdf')
|
|
})
|
|
})
|