1- import { faker } from '@faker-js/faker' ;
21import { VariantAnalysisHistoryItem } from '../../../remote-queries/variant-analysis-history-item' ;
32import { QueryStatus } from '../../../query-status' ;
43import { VariantAnalysisStatus } from '../../../remote-queries/shared/variant-analysis' ;
4+ import { createMockVariantAnalysis } from './shared/variant-analysis' ;
55
66export function createMockVariantAnalysisHistoryItem (
77 historyItemStatus : QueryStatus = QueryStatus . InProgress ,
@@ -16,24 +16,7 @@ export function createMockVariantAnalysisHistoryItem(
1616 resultCount,
1717 status : historyItemStatus ,
1818 completed : false ,
19- variantAnalysis : {
20- 'id' : faker . datatype . number ( ) ,
21- 'controllerRepoId' : faker . datatype . number ( ) ,
22- 'query' : {
23- 'name' : 'Variant Analysis Query History Item' ,
24- 'filePath' : 'PLACEHOLDER/q2.ql' ,
25- 'language' : 'ruby' ,
26- 'text' : '/**\n * @name Variant Analysis Query History Item\n * @kind problem\n * @problem.severity warning\n * @id ruby/example/empty-block\n */\nimport ruby\n\nfrom Block b\nwhere b.getNumberOfStatements() = 0\nselect b, \'This is an empty block.\'\n'
27- } ,
28- 'databases' : {
29- 'repositories' : [ '92384123' , '1230871' ]
30- } ,
31- 'createdAt' : faker . date . recent ( ) . toISOString ( ) ,
32- 'updatedAt' : faker . date . recent ( ) . toISOString ( ) ,
33- 'executionStartTime' : faker . date . recent ( ) . toISOString ( ) ,
34- 'status' : variantAnalysisStatus ,
35- 'actionsWorkflowRunId' : faker . datatype . number ( )
36- } ,
19+ variantAnalysis : createMockVariantAnalysis ( variantAnalysisStatus ) ,
3720 userSpecifiedLabel,
3821 } as unknown ) as VariantAnalysisHistoryItem ;
3922}
0 commit comments