@@ -42,13 +42,13 @@ beforeEach(() => {
4242
4343describe ( 'ColumnsModel' , ( ) => {
4444 const exampleDvcRoot = 'test'
45- const mockedColumnsOrderChanged = buildMockedEventEmitter < void > ( )
45+ const mockedColumnsOrderOrStatusChanged = buildMockedEventEmitter < void > ( )
4646
4747 it ( 'should return the expected columns when given the default output fixture' , async ( ) => {
4848 const model = new ColumnsModel (
4949 '' ,
5050 buildMockMemento ( ) ,
51- mockedColumnsOrderChanged
51+ mockedColumnsOrderOrStatusChanged
5252 )
5353 await model . transformAndSet ( outputFixture )
5454 expect ( mockedGetConfigValue ) . toHaveBeenCalled ( )
@@ -59,7 +59,7 @@ describe('ColumnsModel', () => {
5959 const model = new ColumnsModel (
6060 '' ,
6161 buildMockMemento ( ) ,
62- mockedColumnsOrderChanged
62+ mockedColumnsOrderOrStatusChanged
6363 )
6464 await model . transformAndSet ( survivalOutputFixture )
6565 expect ( model . getSelected ( ) ) . toStrictEqual ( survivalColumnsFixture )
@@ -69,7 +69,7 @@ describe('ColumnsModel', () => {
6969 const model = new ColumnsModel (
7070 '' ,
7171 buildMockMemento ( ) ,
72- mockedColumnsOrderChanged
72+ mockedColumnsOrderOrStatusChanged
7373 )
7474 await model . transformAndSet ( deeplyNestedOutputFixture )
7575 expect ( mockedGetConfigValue ) . toHaveBeenCalled ( )
@@ -81,7 +81,7 @@ describe('ColumnsModel', () => {
8181 const model = new ColumnsModel (
8282 '' ,
8383 buildMockMemento ( ) ,
84- mockedColumnsOrderChanged
84+ mockedColumnsOrderOrStatusChanged
8585 )
8686 await model . transformAndSet ( deeplyNestedOutputFixture )
8787 expect ( mockedGetConfigValue ) . toHaveBeenCalled ( )
@@ -93,7 +93,7 @@ describe('ColumnsModel', () => {
9393 const model = new ColumnsModel (
9494 '' ,
9595 buildMockMemento ( ) ,
96- mockedColumnsOrderChanged
96+ mockedColumnsOrderOrStatusChanged
9797 )
9898 await model . transformAndSet ( deeplyNestedOutputFixture )
9999 expect ( mockedGetConfigValue ) . toHaveBeenCalled ( )
@@ -105,7 +105,7 @@ describe('ColumnsModel', () => {
105105 const model = new ColumnsModel (
106106 '' ,
107107 buildMockMemento ( ) ,
108- mockedColumnsOrderChanged
108+ mockedColumnsOrderOrStatusChanged
109109 )
110110 await model . transformAndSet ( deeplyNestedOutputFixture )
111111 expect ( mockedGetConfigValue ) . toHaveBeenCalled ( )
@@ -117,7 +117,7 @@ describe('ColumnsModel', () => {
117117 const model = new ColumnsModel (
118118 '' ,
119119 buildMockMemento ( ) ,
120- mockedColumnsOrderChanged
120+ mockedColumnsOrderOrStatusChanged
121121 )
122122 await model . transformAndSet ( deeplyNestedOutputFixture )
123123 expect ( mockedGetConfigValue ) . toHaveBeenCalled ( )
@@ -129,7 +129,7 @@ describe('ColumnsModel', () => {
129129 const model = new ColumnsModel (
130130 '' ,
131131 buildMockMemento ( ) ,
132- mockedColumnsOrderChanged
132+ mockedColumnsOrderOrStatusChanged
133133 )
134134 await model . transformAndSet ( deeplyNestedOutputFixture )
135135 expect ( mockedGetConfigValue ) . toHaveBeenCalled ( )
@@ -141,7 +141,7 @@ describe('ColumnsModel', () => {
141141 const model = new ColumnsModel (
142142 '' ,
143143 buildMockMemento ( ) ,
144- mockedColumnsOrderChanged
144+ mockedColumnsOrderOrStatusChanged
145145 )
146146 await model . transformAndSet ( deeplyNestedOutputFixture )
147147 expect ( mockedGetConfigValue ) . toHaveBeenCalled ( )
@@ -152,7 +152,7 @@ describe('ColumnsModel', () => {
152152 const model = new ColumnsModel (
153153 '' ,
154154 buildMockMemento ( ) ,
155- mockedColumnsOrderChanged
155+ mockedColumnsOrderOrStatusChanged
156156 )
157157 await model . transformAndSet ( dataTypesOutputFixture )
158158 expect ( model . getSelected ( ) ) . toStrictEqual ( dataTypesColumnsFixture )
@@ -183,7 +183,7 @@ describe('ColumnsModel', () => {
183183 const model = new ColumnsModel (
184184 exampleDvcRoot ,
185185 buildMockMemento ( ) ,
186- mockedColumnsOrderChanged
186+ mockedColumnsOrderOrStatusChanged
187187 )
188188 await model . transformAndSet ( exampleData )
189189 expect ( model . getSelected ( ) ) . toStrictEqual ( [
@@ -217,7 +217,7 @@ describe('ColumnsModel', () => {
217217 [ testParamPath ] : Status . UNSELECTED
218218 }
219219 } ) ,
220- mockedColumnsOrderChanged
220+ mockedColumnsOrderOrStatusChanged
221221 )
222222 await model . transformAndSet ( exampleData )
223223 expect ( model . getSelected ( ) ) . toStrictEqual ( [
@@ -246,19 +246,20 @@ describe('ColumnsModel', () => {
246246 [ PersistenceKey . METRICS_AND_PARAMS_COLUMN_ORDER + exampleDvcRoot ] :
247247 persistedState
248248 } ) ,
249- mockedColumnsOrderChanged
249+ mockedColumnsOrderOrStatusChanged
250250 )
251251 expect ( model . getColumnOrder ( ) ) . toStrictEqual ( persistedState )
252252 } )
253253
254- it ( 'should return the first three columns from the persisted state' , ( ) => {
254+ it ( 'should return the first three none hidden columns from the persisted state' , async ( ) => {
255255 const persistedState = [
256- { path : 'A' , width : 0 } ,
257- { path : 'B' , width : 0 } ,
258- { path : 'C' , width : 0 } ,
259- { path : 'D' , width : 0 } ,
260- { path : 'E' , width : 0 } ,
261- { path : 'F' , width : 0 }
256+ 'id' ,
257+ 'Created' ,
258+ 'params:params.yaml:dvc_logs_dir' ,
259+ 'params:params.yaml:process.threshold' ,
260+ 'params:params.yaml:process.test_arg' ,
261+ 'deps:src/prepare.py' ,
262+ 'deps:src/featurization.py'
262263 ]
263264
264265 const model = new ColumnsModel (
@@ -267,19 +268,26 @@ describe('ColumnsModel', () => {
267268 [ PersistenceKey . METRICS_AND_PARAMS_COLUMN_ORDER + exampleDvcRoot ] :
268269 persistedState
269270 } ) ,
270- mockedColumnsOrderChanged
271+ mockedColumnsOrderOrStatusChanged
271272 )
273+ await model . transformAndSet ( outputFixture )
272274
273275 expect ( model . getFirstThreeColumnOrder ( ) ) . toStrictEqual (
274276 persistedState . slice ( 1 , 4 )
275277 )
278+
279+ model . toggleStatus ( 'Created' )
280+
281+ expect ( model . getFirstThreeColumnOrder ( ) ) . toStrictEqual (
282+ persistedState . slice ( 2 , 5 )
283+ )
276284 } )
277285
278- it ( 'should return first three columns collected from data if state is empty' , async ( ) => {
286+ it ( 'should return the first three none hidden columns collected from data if state is empty' , async ( ) => {
279287 const model = new ColumnsModel (
280288 exampleDvcRoot ,
281289 buildMockMemento ( ) ,
282- mockedColumnsOrderChanged
290+ mockedColumnsOrderOrStatusChanged
283291 )
284292 await model . transformAndSet ( outputFixture )
285293
@@ -288,6 +296,14 @@ describe('ColumnsModel', () => {
288296 'metrics:summary.json:loss' ,
289297 'metrics:summary.json:accuracy'
290298 ] )
299+
300+ model . toggleStatus ( 'Created' )
301+
302+ expect ( model . getFirstThreeColumnOrder ( ) ) . toStrictEqual ( [
303+ 'metrics:summary.json:loss' ,
304+ 'metrics:summary.json:accuracy' ,
305+ 'metrics:summary.json:val_loss'
306+ ] )
291307 } )
292308
293309 it ( 'should re-order the columns if a new columnOrder is set' , ( ) => {
@@ -300,7 +316,7 @@ describe('ColumnsModel', () => {
300316 { path : 'C' , width : 0 }
301317 ]
302318 } ) ,
303- mockedColumnsOrderChanged
319+ mockedColumnsOrderOrStatusChanged
304320 )
305321 const newState = [ 'C' , 'B' , 'A' ]
306322 model . setColumnOrder ( newState )
@@ -321,7 +337,7 @@ describe('ColumnsModel', () => {
321337 [ PersistenceKey . METRICS_AND_PARAMS_COLUMN_ORDER + exampleDvcRoot ] :
322338 persistedState
323339 } ) ,
324- mockedColumnsOrderChanged
340+ mockedColumnsOrderOrStatusChanged
325341 )
326342 expect ( model . getColumnOrder ( ) ) . toStrictEqual ( persistedState )
327343 } )
@@ -338,7 +354,7 @@ describe('ColumnsModel', () => {
338354 [ PersistenceKey . METRICS_AND_PARAMS_COLUMN_ORDER + exampleDvcRoot ] :
339355 persistedState
340356 } ) ,
341- mockedColumnsOrderChanged
357+ mockedColumnsOrderOrStatusChanged
342358 )
343359 const changedColumnId = 'C'
344360 const expectedWidth = 77
0 commit comments