File tree Expand file tree Collapse file tree 2 files changed +36
-1
lines changed
extension/src/experiments/model Expand file tree Collapse file tree 2 files changed +36
-1
lines changed Original file line number Diff line number Diff line change @@ -129,6 +129,38 @@ describe('collectExperiments', () => {
129129 expect ( continuationCheckpoints ) . toHaveLength ( 0 )
130130 }
131131 } )
132+
133+ it ( 'should handle a checkpoint tip not having a name' , ( ) => {
134+ const checkpointTipWithoutAName = '3fceabdcef3c7b97c7779f8ae0c69a5542eefaf5'
135+
136+ const repoWithNestedCheckpoints = {
137+ branchA : {
138+ baseline : { data : { } } ,
139+ [ checkpointTipWithoutAName ] : {
140+ data : { checkpoint_tip : checkpointTipWithoutAName }
141+ } ,
142+ tip1cp1 : {
143+ data : { checkpoint_tip : checkpointTipWithoutAName }
144+ } ,
145+ tip1cp2 : {
146+ data : { checkpoint_tip : checkpointTipWithoutAName }
147+ } ,
148+ tip1cp3 : {
149+ data : { checkpoint_tip : checkpointTipWithoutAName }
150+ }
151+ } ,
152+ workspace : { baseline : { } }
153+ }
154+ const acc = collectExperiments ( repoWithNestedCheckpoints )
155+
156+ const { experimentsByBranch, checkpointsByTip } = acc
157+ const [ experiment ] = experimentsByBranch . get ( 'branchA' ) || [ ]
158+
159+ expect ( experiment . id ) . toStrictEqual ( checkpointTipWithoutAName )
160+ expect (
161+ checkpointsByTip . get ( checkpointTipWithoutAName ) ?. length
162+ ) . toStrictEqual ( 3 )
163+ } )
132164} )
133165
134166describe ( 'collectMutableRevisions' , ( ) => {
Original file line number Diff line number Diff line change @@ -118,7 +118,10 @@ const getCheckpointTipId = (
118118 if ( ! checkpointTip ) {
119119 return
120120 }
121- return experimentsObject [ checkpointTip ] ?. data ?. name
121+
122+ const tip = experimentsObject [ checkpointTip ] ?. data
123+
124+ return tip ?. name || checkpointTip
122125}
123126
124127const transformColumns = (
You can’t perform that action at this time.
0 commit comments