Fix tests

This commit is contained in:
Adria Navarro 2024-07-22 13:16:42 +02:00
parent 3fa7858712
commit d6e268d475
2 changed files with 5 additions and 2 deletions

View File

@ -75,7 +75,8 @@ export async function update(ctx: UserCtx) {
}
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()
ctx.body = { automations }

View File

@ -398,7 +398,9 @@ describe("/automations", () => {
.expect("Content-Type", /json/)
.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 () => {