From b723ab4cef02a67afa8d8cdc16811d72bef1a9d7 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 29 Jul 2019 20:03:06 +0200 Subject: [PATCH] add failing test for ConcatList update --- src/observable/list/ConcatList.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/observable/list/ConcatList.js b/src/observable/list/ConcatList.js index 49d30ce1..aace70a3 100644 --- a/src/observable/list/ConcatList.js +++ b/src/observable/list/ConcatList.js @@ -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); + }, }; }