1
0
Fork 0
mirror of synced 2024-07-04 22:11:23 +12:00

Some more test case fixes.

This commit is contained in:
mike12345567 2020-10-02 13:04:44 +01:00
parent d4c3200322
commit e0e1cd7316
2 changed files with 5 additions and 26 deletions

View file

@ -18,30 +18,7 @@ exports.create = async function(ctx) {
clientId, clientId,
applicationId: appId, applicationId: appId,
}, },
views: { 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(),
},
},
}) })
// Add the new instance under the app clientDB // Add the new instance under the app clientDB

View file

@ -10,12 +10,14 @@ const {
destroyDocument, destroyDocument,
builderEndpointShouldBlockNormalUsers builderEndpointShouldBlockNormalUsers
} = require("./couchTestUtils") } = require("./couchTestUtils")
let { generateAutomationID } = require("../../../db/utils")
const { delay } = require("./testUtils") const { delay } = require("./testUtils")
const MAX_RETRIES = 4 const MAX_RETRIES = 4
const AUTOMATION_ID = generateAutomationID()
const TEST_AUTOMATION = { const TEST_AUTOMATION = {
_id: "Test Automation", _id: AUTOMATION_ID,
name: "My Automation", name: "My Automation",
pageId: "123123123", pageId: "123123123",
screenId: "kasdkfldsafkl", screenId: "kasdkfldsafkl",
@ -206,7 +208,7 @@ describe("/automations", () => {
.expect('Content-Type', /json/) .expect('Content-Type', /json/)
.expect(200) .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") expect(res.body.automation.name).toEqual("Updated Name")
}) })
}) })