Skip to content

Commit 3e3684a

Browse files
authored
Merge pull request #191 from sylvainpolletvillard/splice-removedCount-issue-with-insertedItems
add failing test for splice removedCount issue with insertedItems
2 parents 793c1ab + b5a254e commit 3e3684a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/ArraySchema.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,14 @@ describe("ArraySchema Tests", () => {
357357
assert.deepStrictEqual(["B", "C", "D", "E"], decodedState.items.map(it => it.name))
358358
assert.strictEqual("A", removedItem.name);
359359

360+
state.items.splice(2, 1, new Item().assign({ name: "F" }));
361+
decodedState.decode(state.encode());
362+
363+
assert.strictEqual(2, onRemoveCount);
364+
assert.strictEqual("D", removedItem.name);
365+
assert.strictEqual(7, onChangeCount);
366+
assert.deepStrictEqual(["B", "C", "F", "E"], decodedState.items.map(it => it.name))
367+
360368
assertDeepStrictEqualEncodeAll(state);
361369
});
362370

0 commit comments

Comments
 (0)