Fix tests
This commit is contained in:
parent
3fa7858712
commit
d6e268d475
|
@ -75,7 +75,8 @@ export async function update(ctx: UserCtx) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function fetch(ctx: UserCtx<void, FetchAutomationResponse>) {
|
export async function fetch(ctx: UserCtx<void, FetchAutomationResponse>) {
|
||||||
const enrich = ctx.request.query["enrich"] === "true"
|
const query = ctx.request.query || {}
|
||||||
|
const enrich = query["enrich"] === "true"
|
||||||
|
|
||||||
const automations = await sdk.automations.fetch()
|
const automations = await sdk.automations.fetch()
|
||||||
ctx.body = { automations }
|
ctx.body = { automations }
|
||||||
|
|
|
@ -398,7 +398,9 @@ describe("/automations", () => {
|
||||||
.expect("Content-Type", /json/)
|
.expect("Content-Type", /json/)
|
||||||
.expect(200)
|
.expect(200)
|
||||||
|
|
||||||
expect(res.body[0]).toEqual(expect.objectContaining(autoConfig))
|
expect(res.body.automations[0]).toEqual(
|
||||||
|
expect.objectContaining(autoConfig)
|
||||||
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
it("should apply authorization to endpoint", async () => {
|
it("should apply authorization to endpoint", async () => {
|
||||||
|
|
Loading…
Reference in New Issue