@@ -194,6 +194,40 @@ describe('ColumnsModel', () => {
194194 expect ( model . getColumnOrder ( ) ) . toStrictEqual ( persistedState )
195195 } )
196196
197+ it ( 'should return the first three columns from the persisted state' , ( ) => {
198+ const persistedState = [
199+ { path : 'A' , width : 0 } ,
200+ { path : 'B' , width : 0 } ,
201+ { path : 'C' , width : 0 } ,
202+ { path : 'D' , width : 0 } ,
203+ { path : 'E' , width : 0 } ,
204+ { path : 'F' , width : 0 }
205+ ]
206+
207+ const model = new ColumnsModel (
208+ exampleDvcRoot ,
209+ buildMockMemento ( {
210+ [ PersistenceKey . METRICS_AND_PARAMS_COLUMN_ORDER + exampleDvcRoot ] :
211+ persistedState
212+ } )
213+ )
214+
215+ expect ( model . getFirstThreeColumnOrder ( ) ) . toStrictEqual (
216+ persistedState . slice ( 1 , 4 )
217+ )
218+ } )
219+
220+ it ( 'should return first three columns collected from data if state is empty' , async ( ) => {
221+ const model = new ColumnsModel ( exampleDvcRoot , buildMockMemento ( ) )
222+ await model . transformAndSet ( outputFixture )
223+
224+ expect ( model . getFirstThreeColumnOrder ( ) ) . toStrictEqual ( [
225+ 'Created' ,
226+ 'metrics:summary.json:loss' ,
227+ 'metrics:summary.json:accuracy'
228+ ] )
229+ } )
230+
197231 it ( 'should re-order the columns if a new columnOrder is set' , ( ) => {
198232 const model = new ColumnsModel (
199233 exampleDvcRoot ,
0 commit comments