Kyle Shockey 7 роки тому
джерело
коміт
2fb04c286b
Не вдалося знайти GPG ключ що відповідає даному підпису Ідентифікатор GPG ключа: 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("")
})
})

Завантаження…
Відмінити
Зберегти