@@ -270,77 +270,3 @@ test('#getValue() returns an empty string if selected index < 0', () => {
270
270
const { foundation} = setupTest ( ) ;
271
271
assert . equal ( foundation . getValue ( ) , '' ) ;
272
272
} ) ;
273
-
274
- test ( 'mousedown event sets bottom line origin' , ( ) => {
275
- const { foundation, mockAdapter} = setupTest ( ) ;
276
- const clickLeftOffset = 50 ;
277
- const mockPointerEvt = td . object ( {
278
- clientX : 100 ,
279
- clientY : 5 ,
280
- target : {
281
- getBoundingClientRect : ( ) => { } ,
282
- } ,
283
- } ) ;
284
- const ctx = td . object ( {
285
- font : 'default font' ,
286
- measureText : ( ) => { } ,
287
- } ) ;
288
- const paddingRight = 16 ;
289
- const paddingLeft = 20 ;
290
- let pointerDownEventHandler ;
291
-
292
- td . when ( mockPointerEvt . target . getBoundingClientRect ( ) ) . thenReturn ( { left : clickLeftOffset } ) ;
293
- td . when ( mockAdapter . create2dRenderingContext ( ) ) . thenReturn ( ctx ) ;
294
- td . when ( mockAdapter . getComputedStyleValue ( 'font' ) ) . thenReturn ( null ) ;
295
- td . when ( mockAdapter . getComputedStyleValue ( 'font-size' ) ) . thenReturn ( '16px' ) ;
296
- td . when ( mockAdapter . getComputedStyleValue ( 'font-family' ) ) . thenReturn ( 'Roboto,sans-serif' ) ;
297
- td . when ( mockAdapter . getComputedStyleValue ( 'letter-spacing' ) ) . thenReturn ( '2.5px' ) ;
298
- td . when ( mockAdapter . getComputedStyleValue ( 'padding-right' ) ) . thenReturn ( `${ paddingRight } px` ) ;
299
- td . when ( mockAdapter . getComputedStyleValue ( 'padding-left' ) ) . thenReturn ( `${ paddingLeft } px` ) ;
300
-
301
- td . when ( mockAdapter . registerInteractionHandler ( 'mousedown' , td . matchers . isA ( Function ) ) ) . thenDo ( ( type , handler ) => {
302
- pointerDownEventHandler = handler ;
303
- } ) ;
304
-
305
- foundation . init ( ) ;
306
- pointerDownEventHandler ( mockPointerEvt ) ;
307
-
308
- td . verify ( mockAdapter . setBottomLineAttr ( 'style' , `transform-origin: ${ clickLeftOffset } px bottom` ) ) ;
309
- } ) ;
310
-
311
- test ( 'touchstart event sets bottom line origin' , ( ) => {
312
- const { foundation, mockAdapter} = setupTest ( ) ;
313
- const clickLeftOffset = 50 ;
314
- const mockPointerEvt = td . object ( {
315
- clientX : 100 ,
316
- clientY : 5 ,
317
- target : {
318
- getBoundingClientRect : ( ) => { } ,
319
- } ,
320
- } ) ;
321
- const ctx = td . object ( {
322
- font : 'default font' ,
323
- measureText : ( ) => { } ,
324
- } ) ;
325
- const paddingRight = 16 ;
326
- const paddingLeft = 20 ;
327
- let pointerDownEventHandler ;
328
-
329
- td . when ( mockPointerEvt . target . getBoundingClientRect ( ) ) . thenReturn ( { left : clickLeftOffset } ) ;
330
- td . when ( mockAdapter . create2dRenderingContext ( ) ) . thenReturn ( ctx ) ;
331
- td . when ( mockAdapter . getComputedStyleValue ( 'font' ) ) . thenReturn ( null ) ;
332
- td . when ( mockAdapter . getComputedStyleValue ( 'font-size' ) ) . thenReturn ( '16px' ) ;
333
- td . when ( mockAdapter . getComputedStyleValue ( 'font-family' ) ) . thenReturn ( 'Roboto,sans-serif' ) ;
334
- td . when ( mockAdapter . getComputedStyleValue ( 'letter-spacing' ) ) . thenReturn ( '2.5px' ) ;
335
- td . when ( mockAdapter . getComputedStyleValue ( 'padding-right' ) ) . thenReturn ( `${ paddingRight } px` ) ;
336
- td . when ( mockAdapter . getComputedStyleValue ( 'padding-left' ) ) . thenReturn ( `${ paddingLeft } px` ) ;
337
-
338
- td . when ( mockAdapter . registerInteractionHandler ( 'touchstart' , td . matchers . isA ( Function ) ) ) . thenDo ( ( type , handler ) => {
339
- pointerDownEventHandler = handler ;
340
- } ) ;
341
-
342
- foundation . init ( ) ;
343
- pointerDownEventHandler ( mockPointerEvt ) ;
344
-
345
- td . verify ( mockAdapter . setBottomLineAttr ( 'style' , `transform-origin: ${ clickLeftOffset } px bottom` ) ) ;
346
- } ) ;
0 commit comments