Minor fix for #8843 - the binding input drawer was using the format helper. rather than helpers. when generating JS helpers.
This commit is contained in:
parent
a3773c57a1
commit
d3029d33ae
|
@ -24,7 +24,7 @@ export function addJSBinding(value, caretPos, binding, { helper } = {}) {
|
||||||
if (!helper) {
|
if (!helper) {
|
||||||
binding = `$("${binding}")`
|
binding = `$("${binding}")`
|
||||||
} else {
|
} else {
|
||||||
binding = `helper.${binding}()`
|
binding = `helpers.${binding}()`
|
||||||
}
|
}
|
||||||
if (caretPos.start) {
|
if (caretPos.start) {
|
||||||
value =
|
value =
|
||||||
|
|
|
@ -129,3 +129,15 @@ describe("Test the JavaScript helper", () => {
|
||||||
expect(output).toBe("Error while executing JS")
|
expect(output).toBe("Error while executing JS")
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
describe("check JS helpers", () => {
|
||||||
|
it("should error if using the format helper. not helpers.", () => {
|
||||||
|
const output = processJS(`return helper.toInt(4.3)`)
|
||||||
|
expect(output).toBe("Error while executing JS")
|
||||||
|
})
|
||||||
|
|
||||||
|
it("should be able to use toInt", () => {
|
||||||
|
const output = processJS(`return helpers.toInt(4.3)`)
|
||||||
|
expect(output).toBe(4)
|
||||||
|
})
|
||||||
|
})
|
Loading…
Reference in New Issue