* move Mocha-run tests to `test/mocha` * fix relative paths * fix JSX test paths * update stagnated JSX tests * `test/setup.js` -> `test/mocha/setup.js` * use regex+globstar for test matching * remove `console.log`
38 lines
863 B
JavaScript
38 lines
863 B
JavaScript
/* eslint-env mocha */
|
|
import React from "react"
|
|
import expect from "expect"
|
|
import { render } from "enzyme"
|
|
import Markdown from "components/providers/markdown"
|
|
|
|
describe("UI-3279: Empty Markdown inputs causing bare `undefined` in output", function(){
|
|
it("should return no text for `null` as source input", function(){
|
|
let props = {
|
|
source: null
|
|
}
|
|
|
|
let el = render(<Markdown {...props}/>)
|
|
|
|
expect(el.text()).toEqual("")
|
|
})
|
|
|
|
it("should return no text for `undefined` as source input", function(){
|
|
let props = {
|
|
source: undefined
|
|
}
|
|
|
|
let el = render(<Markdown {...props}/>)
|
|
|
|
expect(el.text()).toEqual("")
|
|
})
|
|
|
|
it("should return no text for empty string as source input", function(){
|
|
let props = {
|
|
source: ""
|
|
}
|
|
|
|
let el = render(<Markdown {...props}/>)
|
|
|
|
expect(el.text()).toEqual("")
|
|
})
|
|
})
|