Change createMockRemoteQueryHistoryItem to receive resultCount and startTime

Again, we'll need these for sorting.

We also want to be able to set/unset a userSpecifiedLabel. Since this factory
method is used in `history-item-label-provider.test.ts`, we have tests there
that count on this custom label being defined/undefined.
This commit is contained in:
Elena Tanasoiu
2022-11-03 13:58:09 +00:00
parent 44aeaf7d32
commit 0639c66bb0

View File

@@ -5,15 +5,18 @@ export function createMockRemoteQueryHistoryItem({
date = new Date('2022-01-01T00:00:00.000Z'),
status = QueryStatus.InProgress,
failureReason = undefined,
resultCount = 16,
resultCount = undefined,
repositoryCount = 0,
userSpecifiedLabel = undefined,
executionStartTime = date.getTime(),
userSpecifiedLabel = undefined
}: {
date?: Date;
status?: QueryStatus;
failureReason?: string;
resultCount?: number;
repositoryCount?: number;
repositories?: string[];
executionStartTime?: number;
userSpecifiedLabel?: string;
}): RemoteQueryHistoryItem {
return ({
@@ -32,7 +35,7 @@ export function createMockRemoteQueryHistoryItem({
owner: 'github',
name: 'vscode-codeql-integration-tests',
},
executionStartTime: date.getTime(),
executionStartTime,
actionsWorkflowRunId: 1,
repositoryCount,
},