Skip to content

Commit 2fb04c2

Browse files
committed
Add tests
1 parent 21100a0 commit 2fb04c2

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/* eslint-env mocha */
2+
import React from "react"
3+
import expect from "expect"
4+
import { render } from "enzyme"
5+
import Markdown from "components/providers/markdown"
6+
7+
describe("UI-3279: Empty Markdown inputs causing bare `undefined` in output", function(){
8+
it("should return no text for `null` as source input", function(){
9+
let props = {
10+
source: null
11+
}
12+
13+
let el = render(<Markdown {...props}/>)
14+
15+
expect(el.text()).toEqual("")
16+
})
17+
18+
it("should return no text for `undefined` as source input", function(){
19+
let props = {
20+
source: undefined
21+
}
22+
23+
let el = render(<Markdown {...props}/>)
24+
25+
expect(el.text()).toEqual("")
26+
})
27+
28+
it("should return no text for empty string as source input", function(){
29+
let props = {
30+
source: ""
31+
}
32+
33+
let el = render(<Markdown {...props}/>)
34+
35+
expect(el.text()).toEqual("")
36+
})
37+
})

0 commit comments

Comments
 (0)