File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
package/src/components/Attachment/__tests__ Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,15 @@ import { Chat } from '../../Chat/Chat';
2020import { MessageList } from '../../MessageList/MessageList' ;
2121
2222describe ( 'Gallery' , ( ) => {
23+ beforeEach ( ( ) => {
24+ jest . useFakeTimers ( ) ;
25+ } ) ;
26+
27+ afterEach ( ( ) => {
28+ jest . runOnlyPendingTimers ( ) ;
29+ jest . useRealTimers ( ) ;
30+ } ) ;
31+
2332 const user1 = generateUser ( ) ;
2433
2534 const getComponent = async ( attachments = [ ] ) => {
@@ -287,10 +296,10 @@ describe('Gallery', () => {
287296 expect ( screen . getByLabelText ( 'Image Loading Indicator' ) ) . toBeTruthy ( ) ;
288297 } ) ;
289298
290- fireEvent ( screen . getByLabelText ( 'Gallery Image' ) , 'loadEnd ' ) ;
299+ fireEvent ( screen . getByLabelText ( 'Gallery Image' ) , 'onLoad ' ) ;
291300 await waitFor ( ( ) => {
292301 expect ( screen . queryByLabelText ( 'Image Loading Indicator' ) ) . toBeNull ( ) ;
293302 } ) ;
294303 expect ( screen . getByLabelText ( 'Gallery Image' ) ) . toBeTruthy ( ) ;
295- } ) ;
304+ } , 20000 ) ;
296305} ) ;
You can’t perform that action at this time.
0 commit comments