Fixing test case and removing console.log.
This commit is contained in:
parent
6e0f18de87
commit
bfc4a7cc7b
|
@ -14,7 +14,6 @@
|
||||||
$: allowDeleteTrigger = !steps.length
|
$: allowDeleteTrigger = !steps.length
|
||||||
|
|
||||||
function deleteStep() {
|
function deleteStep() {
|
||||||
console.log("Running")
|
|
||||||
automationStore.actions.deleteAutomationBlock(block)
|
automationStore.actions.deleteAutomationBlock(block)
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -4,6 +4,11 @@ module.exports = async (url, opts) => {
|
||||||
function json(body, status = 200) {
|
function json(body, status = 200) {
|
||||||
return {
|
return {
|
||||||
status,
|
status,
|
||||||
|
headers: {
|
||||||
|
get: () => {
|
||||||
|
return ["application/json"]
|
||||||
|
},
|
||||||
|
},
|
||||||
json: async () => {
|
json: async () => {
|
||||||
return body
|
return body
|
||||||
},
|
},
|
||||||
|
|
|
@ -77,7 +77,10 @@ module.exports.run = async function ({ inputs }) {
|
||||||
requestBody.length !== 0 &&
|
requestBody.length !== 0 &&
|
||||||
BODY_REQUESTS.indexOf(requestMethod) !== -1
|
BODY_REQUESTS.indexOf(requestMethod) !== -1
|
||||||
) {
|
) {
|
||||||
request.body = requestBody
|
request.body =
|
||||||
|
typeof requestBody === "string"
|
||||||
|
? requestBody
|
||||||
|
: JSON.stringify(requestBody)
|
||||||
request.headers = {
|
request.headers = {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@ describe("test the outgoing webhook action", () => {
|
||||||
expect(res.success).toEqual(true)
|
expect(res.success).toEqual(true)
|
||||||
expect(res.response.url).toEqual("http://www.test.com")
|
expect(res.response.url).toEqual("http://www.test.com")
|
||||||
expect(res.response.method).toEqual("POST")
|
expect(res.response.method).toEqual("POST")
|
||||||
expect(res.response.body.a).toEqual(1)
|
expect(JSON.parse(res.response.body).a).toEqual(1)
|
||||||
})
|
})
|
||||||
|
|
||||||
it("should return an error if something goes wrong in fetch", async () => {
|
it("should return an error if something goes wrong in fetch", async () => {
|
||||||
|
|
Loading…
Reference in New Issue