personal_area_php/frontend/web/api-doc/test/unit/bugs/3199-sanitization-escaping.jsx
2024-05-24 15:27:07 +03:00

22 lines
582 B
JavaScript

import React from "react"
import { render } from "enzyme"
import Markdown from "components/providers/markdown"
describe("UI-3199: Sanitized Markdown causing code examples to be double escaped", function(){
it("should single-escape quotes", function(){
let str = "" +
"This is a test: \n\n" +
" {\"abc\": \"def\"}\n"
let props = {
source: str
}
let el = render(<Markdown {...props}/>)
expect(el.find("code").first().text()).toEqual("{\"abc\": \"def\"}\n")
expect(el.find("code").first().html()).toEqual("{\"abc\": \"def\"}\n")
})
})