@@ -174,6 +174,48 @@ describe('Toast', () => {
174174 progressBar . isRunning ( ) ;
175175 } ) ;
176176
177+ it ( 'pauses progress bar on mouse pointerup released over the toast' , ( ) => {
178+ cy . mount (
179+ < Toast { ...REQUIRED_PROPS } autoClose = { 5000 } pauseOnHover >
180+ hello
181+ </ Toast >
182+ ) ;
183+
184+ cy . resolveEntranceAnimation ( ) ;
185+ progressBar . isRunning ( ) ;
186+
187+ cy . findByRole ( 'alert' ) . then ( $el => {
188+ const rect = $el [ 0 ] . getBoundingClientRect ( ) ;
189+ cy . wrap ( $el ) . trigger ( 'pointerup' , {
190+ pointerType : 'mouse' ,
191+ clientX : rect . left + rect . width / 2 ,
192+ clientY : rect . top + rect . height / 2
193+ } ) ;
194+ } ) ;
195+ progressBar . isPaused ( ) ;
196+ } ) ;
197+
198+ it ( 'does not pause progress bar on touch pointerup (hover has no meaning for touch)' , ( ) => {
199+ cy . mount (
200+ < Toast { ...REQUIRED_PROPS } autoClose = { 5000 } pauseOnHover >
201+ hello
202+ </ Toast >
203+ ) ;
204+
205+ cy . resolveEntranceAnimation ( ) ;
206+ progressBar . isRunning ( ) ;
207+
208+ cy . findByRole ( 'alert' ) . then ( $el => {
209+ const rect = $el [ 0 ] . getBoundingClientRect ( ) ;
210+ cy . wrap ( $el ) . trigger ( 'pointerup' , {
211+ pointerType : 'touch' ,
212+ clientX : rect . left + rect . width / 2 ,
213+ clientY : rect . top + rect . height / 2
214+ } ) ;
215+ } ) ;
216+ progressBar . isRunning ( ) ;
217+ } ) ;
218+
177219 describe ( 'controller progress bar' , ( ) => {
178220 it ( 'set the correct progress value bar disregarding autoClose value' , ( ) => {
179221 cy . mount (
0 commit comments