mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 12:04:04 +01:00
testing: fix breakage if item has same ID as test controller (#162620)
Fixes #160671
This commit is contained in:
@@ -175,6 +175,8 @@ export class TestItemImpl implements vscode.TestItem {
|
||||
}
|
||||
|
||||
export class TestItemRootImpl extends TestItemImpl {
|
||||
public readonly _isRoot = true;
|
||||
|
||||
constructor(controllerId: string, label: string) {
|
||||
super(controllerId, controllerId, label, undefined);
|
||||
}
|
||||
|
||||
@@ -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(), []);
|
||||
|
||||
Reference in New Issue
Block a user