@@ -16,7 +16,6 @@ import { ExperimentsModel } from '../../../experiments/model'
1616import { ColumnsModel } from '../../../experiments/columns/model'
1717import { DEFAULT_NUM_OF_COMMITS_TO_SHOW } from '../../../cli/dvc/constants'
1818import { PersistenceKey } from '../../../persistence/constants'
19- import { GitReader } from '../../../cli/git/reader'
2019
2120export const buildExperiments = (
2221 disposer : Disposer ,
@@ -142,27 +141,38 @@ const buildExperimentsDataDependencies = (disposer: Disposer) => {
142141 'createFileSystemWatcher'
143142 ) . returns ( undefined )
144143
145- const { dvcReader, internalCommands } = buildInternalCommands ( disposer )
144+ const { dvcReader, gitReader, internalCommands } =
145+ buildInternalCommands ( disposer )
146146 const mockExpShow = stub ( dvcReader , 'expShow' ) . resolves ( expShowFixture )
147- return { internalCommands, mockCreateFileSystemWatcher, mockExpShow }
147+ return {
148+ gitReader,
149+ internalCommands,
150+ mockCreateFileSystemWatcher,
151+ mockExpShow
152+ }
148153}
149154
150155export const buildExperimentsData = (
151156 disposer : SafeWatcherDisposer ,
152157 currentBranch = 'main'
153158) => {
154- stub ( GitReader . prototype , 'getCurrentBranch' ) . resolves ( currentBranch )
159+ const {
160+ internalCommands,
161+ mockExpShow,
162+ mockCreateFileSystemWatcher,
163+ gitReader
164+ } = buildExperimentsDataDependencies ( disposer )
155165
156- const { internalCommands , mockExpShow , mockCreateFileSystemWatcher } =
157- buildExperimentsDataDependencies ( disposer )
166+ stub ( gitReader , 'getCurrentBranch' ) . resolves ( currentBranch )
167+ stub ( gitReader , 'getBranches' ) . resolves ( [ 'one' ] )
158168
159169 const mockGetBranchesToShow = stub ( ) . returns ( [ 'main' ] )
170+ const mockPruneBranchesToShow = stub ( )
160171 const data = disposer . track (
161172 new ExperimentsData ( dvcDemoPath , internalCommands , {
162173 getBranchesToShow : mockGetBranchesToShow ,
163- getNbOfCommitsToShow : ( ) => ( {
164- main : DEFAULT_NUM_OF_COMMITS_TO_SHOW
165- } ) ,
174+ getNbOfCommitsToShow : ( ) => DEFAULT_NUM_OF_COMMITS_TO_SHOW ,
175+ pruneBranchesToShow : mockPruneBranchesToShow ,
166176 setAvailableBranchesToShow : stub ( ) ,
167177 setBranchesToShow : stub ( )
168178 } as unknown as ExperimentsModel )
@@ -172,7 +182,8 @@ export const buildExperimentsData = (
172182 data,
173183 mockCreateFileSystemWatcher,
174184 mockExpShow,
175- mockGetBranchesToShow
185+ mockGetBranchesToShow,
186+ mockPruneBranchesToShow
176187 }
177188}
178189
0 commit comments