1
0
Fork 0
mirror of synced 2024-09-20 19:33:10 +12:00

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 () => {