add failing test for ConcatList update

This commit is contained in:
Bruno Windels 2019-07-29 20:03:06 +02:00
parent 3b7ab8f1c8
commit b723ab4cef

View File

@ -125,6 +125,20 @@ export async function tests() {
list2.insert(1, 11.5);
assert(fired);
},
test_update(assert) {
const list1 = new ObservableArray([1, 2, 3]);
const list2 = new ObservableArray([11, 12, 13]);
const all = new ConcatList(list1, list2);
let fired = false;
all.subscribe({
onUpdate(index, value) {
fired = true;
assert.equal(index, 4);
assert.equal(value, 10);
}
});
list2.emitUpdate(1, 10);
assert(fired);
},
};
}