feat: Copy response to clipboard #4300 (#5278)

* Move next to download button and match styling

Co-authored-by: Aldrin Abastillas <AAbastillas@rcanalytics.com>
Co-authored-by: Tim Lai <timothy.lai@gmail.com>
This commit is contained in:
Aldrin Abastillas
2020-06-15 18:08:10 -04:00
committed by GitHub
parent f8dd4e68ec
commit 973e1f7a9b
9 changed files with 295 additions and 164 deletions

View File

@@ -2,7 +2,6 @@ import React from "react"
import expect from "expect"
import { shallow } from "enzyme"
import ResponseBody from "components/response-body"
import { inferSchema } from "corePlugins/samples/fn"
describe("<ResponseBody />", function() {
const highlightCodeComponent = () => null
@@ -33,4 +32,12 @@ describe("<ResponseBody />", function() {
console.warn(wrapper.debug())
expect(wrapper.find("highlightCodeComponent").length).toEqual(0)
})
it("should render a copyable highlightCodeComponent for text types", function() {
props.contentType = "text/plain"
props.content = "test text"
const wrapper = shallow(<ResponseBody {...props}/>)
console.warn(wrapper.debug())
expect(wrapper.find("highlightCodeComponent[canCopy]").length).toEqual(1)
})
})