Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
rjs_json_form
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
rjs_json_form
Commits
0d88985d
Commit
0d88985d
authored
Aug 21, 2018
by
Boris Kocherov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: catch modified but not notified changes after render
parent
3bdb73b0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
22 deletions
+10
-22
test/jsonform_test.js
test/jsonform_test.js
+10
-22
No files found.
test/jsonform_test.js
View file @
0d88985d
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment