File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change 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+ } )
You can’t perform that action at this time.
0 commit comments