diff --git a/packages/server/src/api/controllers/instance.js b/packages/server/src/api/controllers/instance.js index eb7b205240..02697bb9a0 100644 --- a/packages/server/src/api/controllers/instance.js +++ b/packages/server/src/api/controllers/instance.js @@ -18,30 +18,7 @@ exports.create = async function(ctx) { clientId, applicationId: appId, }, - views: { - by_username: { - map: function(doc) { - if (doc.type === "user") { - emit([doc.username], doc._id) - } - }.toString(), - }, - by_type: { - map: function(doc) { - emit([doc.type], doc._id) - }.toString(), - }, - by_automation_trigger: { - map: function(doc) { - if (doc.type === "automation") { - const trigger = doc.definition.trigger - if (trigger) { - emit([trigger.event], trigger) - } - } - }.toString(), - }, - }, + views: {}, }) // Add the new instance under the app clientDB diff --git a/packages/server/src/api/routes/tests/automation.spec.js b/packages/server/src/api/routes/tests/automation.spec.js index d7a7200f9a..804979dac9 100644 --- a/packages/server/src/api/routes/tests/automation.spec.js +++ b/packages/server/src/api/routes/tests/automation.spec.js @@ -10,12 +10,14 @@ const { destroyDocument, builderEndpointShouldBlockNormalUsers } = require("./couchTestUtils") +let { generateAutomationID } = require("../../../db/utils") const { delay } = require("./testUtils") const MAX_RETRIES = 4 +const AUTOMATION_ID = generateAutomationID() const TEST_AUTOMATION = { - _id: "Test Automation", + _id: AUTOMATION_ID, name: "My Automation", pageId: "123123123", screenId: "kasdkfldsafkl", @@ -206,7 +208,7 @@ describe("/automations", () => { .expect('Content-Type', /json/) .expect(200) - expect(res.body.message).toEqual("Automation Test Automation updated successfully.") + expect(res.body.message).toEqual(`Automation ${AUTOMATION_ID} updated successfully.`) expect(res.body.automation.name).toEqual("Updated Name") }) })