3279-empty-markdown-source.jsx 812 B

123456789101112131415161718192021222324252627282930313233343536
  1. import React from "react"
  2. import { render } from "enzyme"
  3. import Markdown from "components/providers/markdown"
  4. describe("UI-3279: Empty Markdown inputs causing bare `undefined` in output", function(){
  5. it("should return no text for `null` as source input", function(){
  6. let props = {
  7. source: null
  8. }
  9. let el = render(<Markdown {...props}/>)
  10. expect(el.text()).toEqual("")
  11. })
  12. it("should return no text for `undefined` as source input", function(){
  13. let props = {
  14. source: undefined
  15. }
  16. let el = render(<Markdown {...props}/>)
  17. expect(el.text()).toEqual("")
  18. })
  19. it("should return no text for empty string as source input", function(){
  20. let props = {
  21. source: ""
  22. }
  23. let el = render(<Markdown {...props}/>)
  24. expect(el.text()).toEqual("")
  25. })
  26. })