File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
extensions/ql-vscode/src/stories/variant-analysis Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -125,24 +125,22 @@ Example.args = {
125125} ;
126126
127127faker . seed ( 42 ) ;
128- const uniqueStore = { } ;
128+ const uniqueNumbers = [ ... Array ( 1000 ) . keys ( ) ] . sort ( ( ) => Math . random ( ) - 0.5 ) ;
129129
130130const manyScannedRepos = Array . from ( { length : 1000 } , ( _ , i ) => {
131131 const mockedScannedRepo = createMockScannedRepo ( ) ;
132+ const randomInt = uniqueNumbers . pop ( ) ;
133+ const uniqueId =
134+ randomInt === undefined ? Math . floor ( Math . random ( ) * 100000 ) : randomInt ;
132135
133136 return {
134137 ...mockedScannedRepo ,
135138 analysisStatus : VariantAnalysisRepoStatus . Succeeded ,
136139 resultCount : faker . number . int ( { min : 0 , max : 1000 } ) ,
137140 repository : {
138141 ...mockedScannedRepo . repository ,
139- // We need to ensure the ID is unique for React keys
140- id : faker . helpers . unique ( faker . number . int , [ ] , {
141- store : uniqueStore ,
142- } ) ,
143- fullName : `octodemo/${ faker . helpers . unique ( faker . word . sample , [ ] , {
144- store : uniqueStore ,
145- } ) } `,
142+ id : uniqueId ,
143+ fullName : `octodemo/${ uniqueId } ` ,
146144 } ,
147145 } ;
148146} ) ;
You can’t perform that action at this time.
0 commit comments