mirror of
https://github.com/dwaxweiler/connector-mobilizon
synced 2025-06-05 21:59:25 +02:00
escape translated strings to prevent HTML injections
This commit is contained in:
@ -1,6 +1,18 @@
|
||||
import test from 'ava'
|
||||
import { JSDOM } from 'jsdom'
|
||||
|
||||
import Formatter from './formatter.js'
|
||||
|
||||
test.beforeEach(() => {
|
||||
const dom = new JSDOM()
|
||||
global.document = dom.window.document
|
||||
})
|
||||
|
||||
test('#escapeHTML', (t) => {
|
||||
const escaped = Formatter.escapeHTML('<b>a</b>')
|
||||
t.is(escaped, '<b>a</b>')
|
||||
})
|
||||
|
||||
test('#formatDate one date', (t) => {
|
||||
const date = Formatter.formatDate({
|
||||
start: '2021-04-15T10:30:00Z',
|
||||
|
Reference in New Issue
Block a user