Imported Upstream version 4.3.1

This commit is contained in:
Mario Fetka
2021-08-10 02:37:58 +02:00
parent a791de49a2
commit 2f177da8f2
2056 changed files with 421730 additions and 1668138 deletions

View File

@@ -28,7 +28,13 @@ define([
function(builder, FieldBinder, mod_widget, mod_field) { return function() {
QUnit.module('binding');
module('build',{
setup: function() {
},
teardown: function() {
}
});
/**
@@ -36,17 +42,17 @@ QUnit.module('binding');
*
* All three have to have the same value.
*/
QUnit.test('Testing two way bindings', function(assert) {
test('Testing two way bindings', function() {
function test_same_value(value, dirty) {
if (dirty) {
assert.ok(field.dirty, "Field is dirty")
ok(field.dirty, "Field is dirty")
} else {
assert.ok(!field.dirty, "Field is not dirty")
ok(!field.dirty, "Field is not dirty")
}
assert.deepEqual(widget1.get_value(), value, 'Testing Widget 1 value');
assert.deepEqual(widget2.get_value(), value, 'Testing Widget 2 value');
assert.deepEqual(field.get_value(), value, 'Testing Field value');
same(widget1.get_value(), value, 'Testing Widget 1 value');
same(widget2.get_value(), value, 'Testing Widget 2 value');
same(field.get_value(), value, 'Testing Field value');
}
mod_widget.register();
@@ -104,9 +110,9 @@ QUnit.test('Testing two way bindings', function(assert) {
b2.unbind();
field.reset();
widget2.set_value(value3);
assert.deepEqual(widget1.get_value(), value2, 'Testing Widget 1 value');
assert.deepEqual(widget2.get_value(), value3, 'Testing Widget 2 value');
assert.deepEqual(field.get_value(), value, 'Testing Field value');
same(widget1.get_value(), value2, 'Testing Widget 1 value');
same(widget2.get_value(), value3, 'Testing Widget 2 value');
same(field.get_value(), value, 'Testing Field value');
// bind again
b1.bind();