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 @@ ...@@ -125,20 +125,6 @@
}); });
test_settings = { 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 = [ skip_files = [
...@@ -170,6 +156,7 @@ ...@@ -170,6 +156,7 @@
test_id = assert.test.module.name + ': ' + assert.test.testName, test_id = assert.test.module.name + ': ' + assert.test.testName,
settings = test_settings[test_id] || {}, settings = test_settings[test_id] || {},
key = "foo_key", key = "foo_key",
changed = false,
schema_orig; schema_orig;
if (schema !== undefined) { if (schema !== undefined) {
schema_orig = JSON.parse(JSON.stringify(schema)); schema_orig = JSON.parse(JSON.stringify(schema));
...@@ -182,6 +169,8 @@ ...@@ -182,6 +169,8 @@
assert.ok(valid, "form correctly filled"); assert.ok(valid, "form correctly filled");
} else if (method_name === "notifyInvalid") { } else if (method_name === "notifyInvalid") {
assert.notOk(valid, "form incorrectly filled"); assert.notOk(valid, "form incorrectly filled");
} else if (method_name === "notifyChange") {
changed = true;
} else { } else {
throw new renderJS.AcquisitionError("Can not handle " + method_name); throw new renderJS.AcquisitionError("Can not handle " + method_name);
} }
...@@ -217,14 +206,13 @@ ...@@ -217,14 +206,13 @@
} catch (error) { } catch (error) {
assert.notOk("value not parsable:'" + returned_value + "'\n" + error); assert.notOk("value not parsable:'" + returned_value + "'\n" + error);
} }
// XXX disable check side_data errors if (!changed) {
// if (!settings.invert_data_side) { assert.deepEqual(returned_value, value,
// assert.deepEqual(returned_value, value, "document does not changed while rendered");
// "document changed without user interact (side effect on data)"); } else {
// } else { assert.notDeepEqual(returned_value, value,
// assert.notDeepEqual(returned_value, value, "document changed while rendered");
// "document changed without user interact (side effect on data)"); }
// }
}) })
.push(undefined, function (error) { .push(undefined, function (error) {
console.log(test_id); 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