Skip to content

Commit 09abf51

Browse files
authored
Stabilize Windows query history selection test
1 parent 0a08341 commit 09abf51

1 file changed

Lines changed: 20 additions & 12 deletions

File tree

extensions/ql-vscode/test/vscode-tests/no-workspace/query-history/query-history-manager.test.ts

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -363,9 +363,11 @@ describe("QueryHistoryManager", () => {
363363
});
364364

365365
// should be selected
366-
expect(queryHistoryManager.treeDataProvider.getCurrent()).toEqual(
367-
selected,
368-
);
366+
expect(
367+
(
368+
queryHistoryManager.treeDataProvider.getCurrent() as VariantAnalysisHistoryItem
369+
).variantAnalysis.id,
370+
).toBe(selected.variantAnalysis.id);
369371
});
370372

371373
it("should remove the item", async () => {
@@ -384,9 +386,11 @@ describe("QueryHistoryManager", () => {
384386
// remove an item
385387
await queryHistoryManager.handleRemoveHistoryItem([toDelete]);
386388

387-
expect(queryHistoryManager.treeDataProvider.getCurrent()).toEqual(
388-
selected,
389-
);
389+
expect(
390+
(
391+
queryHistoryManager.treeDataProvider.getCurrent() as VariantAnalysisHistoryItem
392+
).variantAnalysis.id,
393+
).toBe(selected.variantAnalysis.id);
390394
expect(variantAnalysisManagerStub.showView).toHaveBeenCalledWith(
391395
selected.variantAnalysis.id,
392396
);
@@ -505,9 +509,11 @@ describe("QueryHistoryManager", () => {
505509
});
506510

507511
// should be selected
508-
expect(queryHistoryManager.treeDataProvider.getCurrent()).toEqual(
509-
selected,
510-
);
512+
expect(
513+
(
514+
queryHistoryManager.treeDataProvider.getCurrent() as VariantAnalysisHistoryItem
515+
).variantAnalysis.id,
516+
).toBe(selected.variantAnalysis.id);
511517

512518
// remove an item
513519
await queryHistoryManager.handleRemoveHistoryItem([toDelete]);
@@ -523,9 +529,11 @@ describe("QueryHistoryManager", () => {
523529
});
524530

525531
it("should not change the selection", () => {
526-
expect(queryHistoryManager.treeDataProvider.getCurrent()).toEqual(
527-
selected,
528-
);
532+
expect(
533+
(
534+
queryHistoryManager.treeDataProvider.getCurrent() as VariantAnalysisHistoryItem
535+
).variantAnalysis.id,
536+
).toBe(selected.variantAnalysis.id);
529537
expect(variantAnalysisManagerStub.showView).toHaveBeenCalledWith(
530538
selected.variantAnalysis.id,
531539
);

0 commit comments

Comments
 (0)