Skip to content

Commit 5f01b4e

Browse files
committed
fix: tests
1 parent 1bea620 commit 5f01b4e

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

package/src/components/Attachment/__tests__/Gallery.test.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@ import { Chat } from '../../Chat/Chat';
2020
import { MessageList } from '../../MessageList/MessageList';
2121

2222
describe('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
});

0 commit comments

Comments
 (0)