testing: fix breakage if item has same ID as test controller (#162620)

Fixes #160671
This commit is contained in:
Connor Peet
2022-10-04 08:41:37 -07:00
committed by GitHub
parent 711c606e90
commit 3b21a16362
4 changed files with 19 additions and 4 deletions

View File

@@ -141,6 +141,19 @@ suite('ExtHost Testing', () => {
assert.strictEqual(ab.parent, a);
});
test('can add an item with same ID as root', () => {
single.collectDiff();
const child = new TestItemImpl('ctrlId', 'ctrlId', 'c', undefined);
single.root.children.add(child);
assert.deepStrictEqual(single.collectDiff(), [
{
op: TestDiffOpType.Add,
item: { controllerId: 'ctrlId', expand: TestItemExpandState.NotExpandable, item: convert.TestItem.from(child) },
}
]);
});
test('no-ops if items not changed', () => {
single.collectDiff();
assert.deepStrictEqual(single.collectDiff(), []);