Commit 0d88985d authored by Boris Kocherov's avatar Boris Kocherov

tests: catch modified but not notified changes after render

parent 3bdb73b0
......@@ -125,20 +125,6 @@
});
test_settings = {
"additionalItems as false without items: ignores non-arrays": {
invert_data_side: "object loaded in array form transform to empety array"
},
"additionalProperties being false does not allow other properties: ignores arrays": {
invert_data_side: "array loaded in object form transform to object",
invert_valid: "getContent return valid "
},
"additionalProperties being false does not allow other properties: ignores strings": {
invert_data_side: "array loaded in object form transform to object",
invert_valid: "form"
},
"additionalProperties being false does not allow other properties: ignores other non-objects": {
invert_data_side: "array loaded in object form transform to object"
}
};
skip_files = [
......@@ -170,6 +156,7 @@
test_id = assert.test.module.name + ': ' + assert.test.testName,
settings = test_settings[test_id] || {},
key = "foo_key",
changed = false,
schema_orig;
if (schema !== undefined) {
schema_orig = JSON.parse(JSON.stringify(schema));
......@@ -182,6 +169,8 @@
assert.ok(valid, "form correctly filled");
} else if (method_name === "notifyInvalid") {
assert.notOk(valid, "form incorrectly filled");
} else if (method_name === "notifyChange") {
changed = true;
} else {
throw new renderJS.AcquisitionError("Can not handle " + method_name);
}
......@@ -217,14 +206,13 @@
} catch (error) {
assert.notOk("value not parsable:'" + returned_value + "'\n" + error);
}
// XXX disable check side_data errors
// if (!settings.invert_data_side) {
// assert.deepEqual(returned_value, value,
// "document changed without user interact (side effect on data)");
// } else {
// assert.notDeepEqual(returned_value, value,
// "document changed without user interact (side effect on data)");
// }
if (!changed) {
assert.deepEqual(returned_value, value,
"document does not changed while rendered");
} else {
assert.notDeepEqual(returned_value, value,
"document changed while rendered");
}
})
.push(undefined, function (error) {
console.log(test_id);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment