Skip to content

Commit d7cc0af

Browse files
authored
Fix some tests (#8656)
* Fix some tests * Improve test
1 parent 2f48bc0 commit d7cc0af

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/test/issues/stateManager.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,17 @@ describe('StateManager branch behavior with useBranchForIssues setting', functio
161161
credentialStore: { isAnyAuthenticated: () => true, getCurrentUser: async () => ({ login: 'testuser' }) },
162162
} as any, mockContext);
163163

164+
(stateManager as any)._queries = [{ label: 'Test', query: 'is:open assignee:@me repo:owner/repo ', groupBy: [] }];
165+
164166
// Manually trigger the setIssueData flow
165167
await (stateManager as any).setIssueData(mockFolderManager);
166168

169+
// Await the collection promise so setIssues completes
170+
const collection = stateManager.getIssueCollection(mockUri);
171+
const testQueryPromise = collection.get('Test');
172+
assert.ok(testQueryPromise, 'Expected issue collection to contain the \'Test\' query label');
173+
await testQueryPromise;
174+
167175
// If we get here without assertion failures in getIssues, the test passed
168176
} finally {
169177
vscode.workspace.getConfiguration = originalGetConfiguration;
@@ -251,6 +259,8 @@ describe('StateManager branch behavior with useBranchForIssues setting', functio
251259
credentialStore: { isAnyAuthenticated: () => true, getCurrentUser: async () => ({ login: 'testuser' }) },
252260
} as any, mockContext);
253261

262+
(sm as any)._queries = [{ label: 'Test', query: 'is:open repo:owner/repo', groupBy: [] }];
263+
254264
await (sm as any).setIssueData(mockFolderManager);
255265

256266
// Verify that the promises in issueCollection resolve (not reject)

0 commit comments

Comments
 (0)