Skip to content
Permalink
Browse files

fix(tests): add failing test for whitespace jexl expressions

  • Loading branch information...
anehx authored and czosel committed Jul 18, 2019
1 parent 8040e05 commit ba7d236e7284101935be871a884125a6c267d42f
Showing with 14 additions and 0 deletions.
  1. +14 −0 tests/unit/lib/field-test.js
@@ -196,6 +196,20 @@ module("Unit | Library | field", function(hooks) {

assert.deepEqual(field.optionalDependencies, ["test-question"]);
});

test("it can handle newlines in JEXL expressions", async function(assert) {
assert.expect(2);

const field = this.document.findField("test-question-2");

const whitespaced = "(\n 1 == 1\n &&\n 2 == 2\n)";

field.question.set("isHidden", whitespaced);
field.question.set("isRequired", whitespaced);

assert.equal(await field.hiddenTask.perform(), true);
assert.equal(await field.optionalTask.perform(), false);
});
});

module("validation", function() {

0 comments on commit ba7d236

Please sign in to comment.
You can’t perform that action at this time.