Adding test case.

This commit is contained in:
mike12345567 2024-03-19 13:22:43 +00:00
parent 68bc7bbdf5
commit abdff7d8e6
1 changed files with 15 additions and 0 deletions

View File

@ -408,6 +408,21 @@ describe("/queries", () => {
}, },
}) })
}) })
it("shouldn't allow handlebars to be passed as parameters", async () => {
const res = await request
.post(`/api/queries/${query._id}`)
.send({
parameters: {
a: "{{ 'test' }}",
},
})
.set(config.defaultHeaders())
.expect(400)
expect(res.body.message).toEqual(
"Parameter 'a' input contains a handlebars binding - this is not allowed."
)
})
}) })
describe("variables", () => { describe("variables", () => {