@@ -230,102 +230,4 @@ describe('stack', () => {
230230 getComputedStyleSpy . mockRestore ( ) ;
231231 offsetHeightSpy . mockRestore ( ) ;
232232 } ) ;
233-
234- it ( 'supports touch scroll on mobile' , ( ) => {
235- const clientHeightSpy = vi
236- . spyOn ( HTMLElement . prototype , 'clientHeight' , 'get' )
237- . mockImplementation ( function mockClientHeight ( ) {
238- if ( this . classList ?. contains ( 'rc-notification-list' ) ) {
239- return 120 ;
240- }
241-
242- return 0 ;
243- } ) ;
244- const scrollHeightSpy = vi
245- . spyOn ( HTMLElement . prototype , 'scrollHeight' , 'get' )
246- . mockImplementation ( function mockScrollHeight ( ) {
247- if ( this . classList ?. contains ( 'rc-notification-list-content' ) ) {
248- return 300 ;
249- }
250-
251- return 0 ;
252- } ) ;
253-
254- render (
255- < NotificationList
256- placement = "topRight"
257- configList = { Array . from ( { length : 5 } , ( _ , index ) => ( {
258- key : index ,
259- description : `Notice ${ index } ` ,
260- duration : false ,
261- } ) ) }
262- /> ,
263- ) ;
264-
265- const list = document . querySelector < HTMLElement > ( '.rc-notification-list' ) ;
266- const content = document . querySelector < HTMLElement > ( '.rc-notification-list-content' ) ;
267-
268- fireEvent . touchStart ( list ! , {
269- touches : [ { clientY : 120 } ] ,
270- } ) ;
271- fireEvent . touchMove ( list ! , {
272- touches : [ { clientY : 60 } ] ,
273- } ) ;
274-
275- expect ( content ?. style . transform ) . toBe ( 'translate3d(0, -60px, 0)' ) ;
276-
277- fireEvent . touchEnd ( list ! ) ;
278-
279- clientHeightSpy . mockRestore ( ) ;
280- scrollHeightSpy . mockRestore ( ) ;
281- } ) ;
282-
283- it ( 'resets scroll offset when stack collapses after hover leave' , ( ) => {
284- const clientHeightSpy = vi
285- . spyOn ( HTMLElement . prototype , 'clientHeight' , 'get' )
286- . mockImplementation ( function mockClientHeight ( ) {
287- if ( this . classList ?. contains ( 'rc-notification-list' ) ) {
288- return 120 ;
289- }
290-
291- return 0 ;
292- } ) ;
293- const scrollHeightSpy = vi
294- . spyOn ( HTMLElement . prototype , 'scrollHeight' , 'get' )
295- . mockImplementation ( function mockScrollHeight ( ) {
296- if ( this . classList ?. contains ( 'rc-notification-list-content' ) ) {
297- return 300 ;
298- }
299-
300- return 0 ;
301- } ) ;
302-
303- render (
304- < NotificationList
305- placement = "topRight"
306- stack = { { threshold : 3 } }
307- configList = { Array . from ( { length : 5 } , ( _ , index ) => ( {
308- key : index ,
309- description : `Notice ${ index } ` ,
310- duration : false ,
311- } ) ) }
312- /> ,
313- ) ;
314-
315- const list = document . querySelector < HTMLElement > ( '.rc-notification-list' ) ;
316- const content = document . querySelector < HTMLElement > ( '.rc-notification-list-content' ) ;
317-
318- fireEvent . mouseEnter ( list ! ) ;
319- fireEvent . wheel ( list ! , { deltaY : 60 } ) ;
320-
321- expect ( content ?. style . transform ) . toBe ( 'translate3d(0, -60px, 0)' ) ;
322-
323- fireEvent . mouseLeave ( list ! ) ;
324-
325- expect ( list ) . not . toHaveClass ( 'rc-notification-stack-expanded' ) ;
326- expect ( content ?. style . transform ) . toBe ( 'translate3d(0, 0px, 0)' ) ;
327-
328- clientHeightSpy . mockRestore ( ) ;
329- scrollHeightSpy . mockRestore ( ) ;
330- } ) ;
331233} ) ;
0 commit comments