@@ -18,8 +18,8 @@ import scatterTemplate from '../../test/fixtures/plotsDiff/templates/scatter'
1818import smoothTemplate from '../../test/fixtures/plotsDiff/templates/smooth'
1919import multiSourceTemplate from '../../test/fixtures/plotsDiff/templates/multiSource'
2020import { copyOriginalColors } from '../../experiments/model/status/colors'
21- import { PlotNumberOfItemsPerRow } from '../webview/contract'
2221import { EXPERIMENT_WORKSPACE_ID } from '../../cli/dvc/contract'
22+ import { DEFAULT_NB_ITEMS_PER_REOW } from '../webview/contract'
2323
2424describe ( 'isMultiViewPlot' , ( ) => {
2525 it ( 'should recognize the confusion matrix template as a multi view plot' , ( ) => {
@@ -86,7 +86,7 @@ describe('extendVegaSpec', () => {
8686 it ( 'should not add encoding if no color scale is provided' , ( ) => {
8787 const extendedSpec = extendVegaSpec (
8888 linearTemplate ,
89- PlotNumberOfItemsPerRow . TWO
89+ DEFAULT_NB_ITEMS_PER_REOW
9090 )
9191 expect ( extendedSpec . encoding ) . toBeUndefined ( )
9292 } )
@@ -98,7 +98,7 @@ describe('extendVegaSpec', () => {
9898 }
9999 const extendedSpec = extendVegaSpec (
100100 linearTemplate ,
101- PlotNumberOfItemsPerRow . TWO ,
101+ DEFAULT_NB_ITEMS_PER_REOW ,
102102 {
103103 color : colorScale
104104 }
@@ -143,7 +143,7 @@ describe('extendVegaSpec', () => {
143143
144144 it ( 'should truncate all titles from the left to 50 characters for large plots' , ( ) => {
145145 const spec = withLongTemplatePlotTitle ( )
146- const updatedSpec = extendVegaSpec ( spec , PlotNumberOfItemsPerRow . ONE )
146+ const updatedSpec = extendVegaSpec ( spec , 1 )
147147
148148 const truncatedTitle = '…-many-many-characters-at-least-seventy-characters'
149149 const truncatedHorizontalTitle =
@@ -169,7 +169,7 @@ describe('extendVegaSpec', () => {
169169
170170 it ( 'should truncate all titles from the left to 50 characters for regular plots' , ( ) => {
171171 const spec = withLongTemplatePlotTitle ( )
172- const updatedSpec = extendVegaSpec ( spec , PlotNumberOfItemsPerRow . TWO )
172+ const updatedSpec = extendVegaSpec ( spec , DEFAULT_NB_ITEMS_PER_REOW )
173173
174174 const truncatedTitle = '…-many-many-characters-at-least-seventy-characters'
175175 const truncatedHorizontalTitle =
@@ -195,7 +195,7 @@ describe('extendVegaSpec', () => {
195195
196196 it ( 'should truncate all titles from the left to 30 characters for small plots' , ( ) => {
197197 const spec = withLongTemplatePlotTitle ( )
198- const updatedSpec = extendVegaSpec ( spec , PlotNumberOfItemsPerRow . THREE )
198+ const updatedSpec = extendVegaSpec ( spec , 3 )
199199
200200 const truncatedTitle = '…s-at-least-seventy-characters'
201201 const truncatedHorizontalTitle = '…at-least-seventy-characters-x'
@@ -225,7 +225,7 @@ describe('extendVegaSpec', () => {
225225 text : repeatedTitle
226226 } )
227227
228- const updatedSpec = extendVegaSpec ( spec , PlotNumberOfItemsPerRow . THREE )
228+ const updatedSpec = extendVegaSpec ( spec , 3 )
229229
230230 const truncatedTitle = '…ghijklmnopqrstuvwyz1234567890'
231231
@@ -242,7 +242,7 @@ describe('extendVegaSpec', () => {
242242 const repeatedTitle = 'abcdefghijklmnopqrstuvwyz1234567890'
243243 const spec = withLongTemplatePlotTitle ( [ repeatedTitle , repeatedTitle ] )
244244
245- const updatedSpec = extendVegaSpec ( spec , PlotNumberOfItemsPerRow . THREE )
245+ const updatedSpec = extendVegaSpec ( spec , 3 )
246246
247247 const truncatedTitle = '…ghijklmnopqrstuvwyz1234567890'
248248
@@ -262,7 +262,7 @@ describe('extendVegaSpec', () => {
262262 text : [ repeatedTitle , repeatedTitle ]
263263 } )
264264
265- const updatedSpec = extendVegaSpec ( spec , PlotNumberOfItemsPerRow . THREE )
265+ const updatedSpec = extendVegaSpec ( spec , 3 )
266266
267267 const truncatedTitle = '…ghijklmnopqrstuvwyz1234567890'
268268
@@ -276,17 +276,13 @@ describe('extendVegaSpec', () => {
276276 } )
277277
278278 it ( 'should update the multi-source template to remove erroneous shape encoding from the vertical line displayed on hover' , ( ) => {
279- const updatedSpec = extendVegaSpec (
280- multiSourceTemplate ,
281- PlotNumberOfItemsPerRow . ONE ,
282- {
283- color : { domain : [ ] , range : [ ] } ,
284- shape : {
285- field : 'field' ,
286- scale : { domain : [ ] , range : [ ] }
287- }
279+ const updatedSpec = extendVegaSpec ( multiSourceTemplate , 1 , {
280+ color : { domain : [ ] , range : [ ] } ,
281+ shape : {
282+ field : 'field' ,
283+ scale : { domain : [ ] , range : [ ] }
288284 }
289- )
285+ } )
290286
291287 expect ( updatedSpec . encoding ) . not . toBeUndefined ( )
292288 expect ( updatedSpec . layer [ 1 ] . layer [ 0 ] . encoding . shape ) . toBeNull ( )
0 commit comments