some tidy up

This commit is contained in:
Peter Clement 2021-10-13 09:29:01 +01:00
parent 64583f83c6
commit 2105fb31db
3 changed files with 13 additions and 3 deletions

View File

@ -6,6 +6,7 @@
import AttachmentRenderer from "./AttachmentRenderer.svelte" import AttachmentRenderer from "./AttachmentRenderer.svelte"
import ArrayRenderer from "./ArrayRenderer.svelte" import ArrayRenderer from "./ArrayRenderer.svelte"
import InternalRenderer from "./InternalRenderer.svelte" import InternalRenderer from "./InternalRenderer.svelte"
export let row export let row
export let schema export let schema
export let value export let value
@ -31,7 +32,7 @@
// the schema gets overriden on every tables fetch so we can't just set // the schema gets overriden on every tables fetch so we can't just set
// these to be a new type unfortunately // these to be a new type unfortunately
if (schema.name === "_id" || schema.name === "_rev") { if (schema.name === "_id" || schema.name === "_rev") {
renderer = customRenderer?.component ?? typeMap.internal ?? StringRenderer renderer = typeMap.internal
} else { } else {
renderer = customRenderer?.component ?? typeMap[type] ?? StringRenderer renderer = customRenderer?.component ?? typeMap[type] ?? StringRenderer
} }

View File

@ -33,7 +33,6 @@
export let testData export let testData
export let schemaProperties export let schemaProperties
export let isTestModal = false export let isTestModal = false
let webhookModal let webhookModal
let drawer let drawer
let tempFilters = lookForFilters(schemaProperties) || [] let tempFilters = lookForFilters(schemaProperties) || []
@ -58,7 +57,10 @@
// Special case for webhook, as it requires a body, but the schema already brings back the body's contents // Special case for webhook, as it requires a body, but the schema already brings back the body's contents
if (stepId === "WEBHOOK") { if (stepId === "WEBHOOK") {
automationStore.actions.addTestDataToAutomation({ automationStore.actions.addTestDataToAutomation({
body: { [key]: e.detail }, body: {
[key]: e.detail,
...$automationStore.selectedAutomation.automation.testData.body,
},
}) })
} }
automationStore.actions.addTestDataToAutomation({ automationStore.actions.addTestDataToAutomation({

View File

@ -1,5 +1,12 @@
jest.mock("../../utilities/usageQuota") jest.mock("../../utilities/usageQuota")
jest.mock("../thread") jest.mock("../thread")
jest.mock("../../utilities/redis", () => ({
init: jest.fn(),
checkTestFlag: () => {
return false
},
}))
jest.spyOn(global.console, "error") jest.spyOn(global.console, "error")
require("../../environment") require("../../environment")