@@ -18,7 +18,7 @@ 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 { PlotSize } from '../webview/contract'
21+ import { PlotSizeNumber } from '../webview/contract'
2222
2323describe ( 'isMultiViewPlot' , ( ) => {
2424 it ( 'should recognize the confusion matrix template as a multi view plot' , ( ) => {
@@ -83,7 +83,7 @@ describe('getColorScale', () => {
8383
8484describe ( 'extendVegaSpec' , ( ) => {
8585 it ( 'should not add encoding if no color scale is provided' , ( ) => {
86- const extendedSpec = extendVegaSpec ( linearTemplate , PlotSize . REGULAR )
86+ const extendedSpec = extendVegaSpec ( linearTemplate , PlotSizeNumber . REGULAR )
8787 expect ( extendedSpec . encoding ) . toBeUndefined ( )
8888 } )
8989
@@ -92,9 +92,13 @@ describe('extendVegaSpec', () => {
9292 domain : [ 'workspace' , 'main' ] ,
9393 range : copyOriginalColors ( ) . slice ( 0 , 2 )
9494 }
95- const extendedSpec = extendVegaSpec ( linearTemplate , PlotSize . REGULAR , {
96- color : colorScale
97- } )
95+ const extendedSpec = extendVegaSpec (
96+ linearTemplate ,
97+ PlotSizeNumber . REGULAR ,
98+ {
99+ color : colorScale
100+ }
101+ )
98102
99103 expect ( extendedSpec ) . not . toStrictEqual ( defaultTemplate )
100104 expect ( extendedSpec . encoding . color ) . toStrictEqual ( {
@@ -135,7 +139,7 @@ describe('extendVegaSpec', () => {
135139
136140 it ( 'should truncate all titles from the left to 50 characters for large plots' , ( ) => {
137141 const spec = withLongTemplatePlotTitle ( )
138- const updatedSpec = extendVegaSpec ( spec , PlotSize . LARGE )
142+ const updatedSpec = extendVegaSpec ( spec , 500 )
139143
140144 const truncatedTitle = '…-many-many-characters-at-least-seventy-characters'
141145 const truncatedHorizontalTitle =
@@ -161,7 +165,7 @@ describe('extendVegaSpec', () => {
161165
162166 it ( 'should truncate all titles from the left to 50 characters for regular plots' , ( ) => {
163167 const spec = withLongTemplatePlotTitle ( )
164- const updatedSpec = extendVegaSpec ( spec , PlotSize . REGULAR )
168+ const updatedSpec = extendVegaSpec ( spec , PlotSizeNumber . REGULAR )
165169
166170 const truncatedTitle = '…-many-many-characters-at-least-seventy-characters'
167171 const truncatedHorizontalTitle =
@@ -187,7 +191,7 @@ describe('extendVegaSpec', () => {
187191
188192 it ( 'should truncate all titles from the left to 30 characters for small plots' , ( ) => {
189193 const spec = withLongTemplatePlotTitle ( )
190- const updatedSpec = extendVegaSpec ( spec , PlotSize . SMALL )
194+ const updatedSpec = extendVegaSpec ( spec , 300 )
191195
192196 const truncatedTitle = '…s-at-least-seventy-characters'
193197 const truncatedHorizontalTitle = '…at-least-seventy-characters-x'
@@ -217,7 +221,7 @@ describe('extendVegaSpec', () => {
217221 text : repeatedTitle
218222 } )
219223
220- const updatedSpec = extendVegaSpec ( spec , PlotSize . SMALL )
224+ const updatedSpec = extendVegaSpec ( spec , 300 )
221225
222226 const truncatedTitle = '…ghijklmnopqrstuvwyz1234567890'
223227
@@ -234,7 +238,7 @@ describe('extendVegaSpec', () => {
234238 const repeatedTitle = 'abcdefghijklmnopqrstuvwyz1234567890'
235239 const spec = withLongTemplatePlotTitle ( [ repeatedTitle , repeatedTitle ] )
236240
237- const updatedSpec = extendVegaSpec ( spec , PlotSize . SMALL )
241+ const updatedSpec = extendVegaSpec ( spec , 300 )
238242
239243 const truncatedTitle = '…ghijklmnopqrstuvwyz1234567890'
240244
@@ -254,7 +258,7 @@ describe('extendVegaSpec', () => {
254258 text : [ repeatedTitle , repeatedTitle ]
255259 } )
256260
257- const updatedSpec = extendVegaSpec ( spec , PlotSize . SMALL )
261+ const updatedSpec = extendVegaSpec ( spec , 300 )
258262
259263 const truncatedTitle = '…ghijklmnopqrstuvwyz1234567890'
260264
@@ -268,7 +272,7 @@ describe('extendVegaSpec', () => {
268272 } )
269273
270274 it ( 'should update the multi-source template to remove erroneous shape encoding from the vertical line displayed on hover' , ( ) => {
271- const updatedSpec = extendVegaSpec ( multiSourceTemplate , PlotSize . LARGE , {
275+ const updatedSpec = extendVegaSpec ( multiSourceTemplate , 500 , {
272276 color : { domain : [ ] , range : [ ] } ,
273277 shape : {
274278 field : 'field' ,
0 commit comments