浏览代码

Add tests

bubble
Kyle Shockey 7 年前
父节点
当前提交
2fb04c286b
找不到此签名对应的密钥 GPG 密钥 ID: DC20D559FFBC0D36
共有 1 个文件被更改,包括 37 次插入0 次删除
  1. +37
    -0
      test/bugs/3279-empty-markdown-source.js

+ 37
- 0
test/bugs/3279-empty-markdown-source.js 查看文件

@@ -0,0 +1,37 @@
/* 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("")
})
})

正在加载...
取消
保存