* config(jest): updated setup * config(jest): update testMatch to include jsx files * config(jest): add transformIgnorePatterns * config(jest): update ignore files that do not work in jest yet * config: add test:unit-jest to test script * fix(jest): lint with eslint-plugin-jest * refactor(jest): move unit test directory * refactor(mocha): restore mocha tests that fail in jest * docs(jest): update helpful scripts with test:unit-jest
22 lines
598 B
JavaScript
22 lines
598 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")
|
|
})
|
|
})
|