From 19bbb0720fda720b980ce2a53f977bbbea5d0249 Mon Sep 17 00:00:00 2001 From: Alex Ross <38270282+alexr00@users.noreply.github.com> Date: Thu, 9 Apr 2026 12:02:14 +0200 Subject: [PATCH 1/2] Fix some tests --- src/test/issues/stateManager.test.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/test/issues/stateManager.test.ts b/src/test/issues/stateManager.test.ts index b315056393..1b690ee5a5 100644 --- a/src/test/issues/stateManager.test.ts +++ b/src/test/issues/stateManager.test.ts @@ -161,9 +161,15 @@ describe('StateManager branch behavior with useBranchForIssues setting', functio credentialStore: { isAnyAuthenticated: () => true, getCurrentUser: async () => ({ login: 'testuser' }) }, } as any, mockContext); + (stateManager as any)._queries = [{ label: 'Test', query: 'is:open assignee:@me repo:owner/repo ', groupBy: [] }]; + // Manually trigger the setIssueData flow await (stateManager as any).setIssueData(mockFolderManager); + // Await the collection promise so setIssues completes + const collection = stateManager.getIssueCollection(mockUri); + await collection.get('Test'); + // If we get here without assertion failures in getIssues, the test passed } finally { vscode.workspace.getConfiguration = originalGetConfiguration; @@ -251,6 +257,8 @@ describe('StateManager branch behavior with useBranchForIssues setting', functio credentialStore: { isAnyAuthenticated: () => true, getCurrentUser: async () => ({ login: 'testuser' }) }, } as any, mockContext); + (sm as any)._queries = [{ label: 'Test', query: 'is:open repo:owner/repo', groupBy: [] }]; + await (sm as any).setIssueData(mockFolderManager); // Verify that the promises in issueCollection resolve (not reject) From 2719394d4a6aaf39e4133a7d2607fd9620b07ec7 Mon Sep 17 00:00:00 2001 From: Alex Ross <38270282+alexr00@users.noreply.github.com> Date: Thu, 9 Apr 2026 12:08:56 +0200 Subject: [PATCH 2/2] Improve test --- src/test/issues/stateManager.test.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/test/issues/stateManager.test.ts b/src/test/issues/stateManager.test.ts index 1b690ee5a5..9102149dc9 100644 --- a/src/test/issues/stateManager.test.ts +++ b/src/test/issues/stateManager.test.ts @@ -168,7 +168,9 @@ describe('StateManager branch behavior with useBranchForIssues setting', functio // Await the collection promise so setIssues completes const collection = stateManager.getIssueCollection(mockUri); - await collection.get('Test'); + const testQueryPromise = collection.get('Test'); + assert.ok(testQueryPromise, 'Expected issue collection to contain the \'Test\' query label'); + await testQueryPromise; // If we get here without assertion failures in getIssues, the test passed } finally {