fix(response-body): remove download button when content is empty (#8579)
Co-authored-by: Vladimír Gorej <vladimir.gorej@gmail.com>
This commit is contained in:
committed by
GitHub
parent
043d5ea455
commit
cdfc4de43e
@@ -39,4 +39,18 @@ describe("<ResponseBody />", function () {
|
||||
console.warn(wrapper.debug())
|
||||
expect(wrapper.find("highlightCodeComponent[canCopy]").length).toEqual(1)
|
||||
})
|
||||
|
||||
it("should render Download file link for non-empty response", function () {
|
||||
props.contentType = "application/octet-stream"
|
||||
props.content = new Blob(["\"test\""], { type: props.contentType })
|
||||
const wrapper = shallow(<ResponseBody {...props} />)
|
||||
expect(wrapper.text()).toMatch(/Download file/)
|
||||
})
|
||||
|
||||
it("should not render Download file link for empty response", function () {
|
||||
props.contentType = "application/octet-stream"
|
||||
props.content = new Blob()
|
||||
const wrapper = shallow(<ResponseBody {...props} />)
|
||||
expect(wrapper.text()).not.toMatch(/Download file/)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user