Skip to content

Commit e73a19b

Browse files
authored
Fix typing in asyncDataTree.test.ts (microsoft#209394)
* Fix typing in asyncDataTree.test.ts * Removing typing entirely now that `querySelector` returns `HTMLElement | null`
1 parent 2ed2eb3 commit e73a19b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/vs/base/test/browser/ui/tree/asyncDataTree.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ suite('AsyncDataTree', function () {
307307
assert(!aNode.collapsed);
308308
assert.equal(aNode.children.length, 1);
309309
assert.equal(aNode.children[0].element.id, 'b');
310-
const bChild = container.querySelector('.monaco-list-row:nth-child(2)') as HTMLElement | undefined;
310+
const bChild = container.querySelector('.monaco-list-row:nth-child(2)');
311311
assert.equal(bChild?.textContent, 'b');
312312
tree.collapse(a);
313313
assert(aNode.collapsed);
@@ -319,8 +319,8 @@ suite('AsyncDataTree', function () {
319319
assert.equal(aNodeUpdated1.children.length, 0);
320320
let didCheckNoChildren = false;
321321
const event = tree.onDidChangeCollapseState(e => {
322-
const child = container.querySelector('.monaco-list-row:nth-child(2)') as HTMLElement | undefined;
323-
assert.equal(child, undefined);
322+
const child = container.querySelector('.monaco-list-row:nth-child(2)');
323+
assert.equal(child, null);
324324
didCheckNoChildren = true;
325325
});
326326
await tree.expand(aUpdated1);
@@ -331,7 +331,7 @@ suite('AsyncDataTree', function () {
331331
assert(!aNodeUpdated2.collapsed);
332332
assert.equal(aNodeUpdated2.children.length, 1);
333333
assert.equal(aNodeUpdated2.children[0].element.id, 'c');
334-
const child = container.querySelector('.monaco-list-row:nth-child(2)') as HTMLElement | undefined;
334+
const child = container.querySelector('.monaco-list-row:nth-child(2)');
335335
assert.equal(child?.textContent, 'c');
336336
});
337337

@@ -364,7 +364,7 @@ suite('AsyncDataTree', function () {
364364
assert(!aNode.collapsed);
365365
assert.equal(aNode.children.length, 1);
366366
assert.equal(aNode.children[0].element.id, 'b');
367-
const bChild = container.querySelector('.monaco-list-row:nth-child(2)') as HTMLElement | undefined;
367+
const bChild = container.querySelector('.monaco-list-row:nth-child(2)');
368368
assert.equal(bChild?.textContent, 'b');
369369
tree.collapse(a);
370370
assert(aNode.collapsed);
@@ -375,7 +375,7 @@ suite('AsyncDataTree', function () {
375375
assert.equal(aNodeUpdated1.children.length, 1);
376376
let didCheckSameChildren = false;
377377
const event = tree.onDidChangeCollapseState(e => {
378-
const child = container.querySelector('.monaco-list-row:nth-child(2)') as HTMLElement | undefined;
378+
const child = container.querySelector('.monaco-list-row:nth-child(2)');
379379
assert.equal(child?.textContent, 'b');
380380
didCheckSameChildren = true;
381381
});
@@ -387,7 +387,7 @@ suite('AsyncDataTree', function () {
387387
assert(!aNodeUpdated2.collapsed);
388388
assert.equal(aNodeUpdated2.children.length, 1);
389389
assert.equal(aNodeUpdated2.children[0].element.id, 'b');
390-
const child = container.querySelector('.monaco-list-row:nth-child(2)') as HTMLElement | undefined;
390+
const child = container.querySelector('.monaco-list-row:nth-child(2)');
391391
assert.equal(child?.textContent, 'b');
392392
});
393393

0 commit comments

Comments
 (0)