Some checks failed
Node.js CI / build (push) Failing after 2s
Node.js CI / e2e-tests (+(a11y|security|bugs)/**/*cy.js) (push) Failing after 2s
Node.js CI / e2e-tests (features/**/!(o|d|m)*.cy.js) (push) Failing after 2s
Node.js CI / e2e-tests (features/**/+(o|d)*.cy.js) (push) Failing after 2s
Node.js CI / e2e-tests (features/**/m*.cy.js) (push) Failing after 2s
CodeQL / Analyze (javascript) (push) Failing after 2m49s
Security scan for docker image / build (push) Failing after 54s
36 lines
817 B
JavaScript
Executable File
36 lines
817 B
JavaScript
Executable File
import React from "react"
|
|
import { render } from "enzyme"
|
|
import Markdown from "core/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("")
|
|
})
|
|
})
|