Skip to content

Commit 812f825

Browse files
author
Davide Botrugno
committed
Merge branch 'main' into fix-data-center-regions
2 parents 05b0a0a + 9177c03 commit 812f825

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/__tests__/WebChatContainer.test.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,22 @@ import { UserDefinedResponseEvent } from '../types/UserDefinedResponseEvent';
2121

2222
jest.setTimeout(20000);
2323

24+
class ResizeObserverMock {
25+
observe = jest.fn();
26+
27+
unobserve = jest.fn();
28+
29+
disconnect = jest.fn();
30+
}
31+
2432
describe('WebChatContainer', () => {
33+
beforeAll(() => {
34+
Object.defineProperty(window, 'ResizeObserver', {
35+
writable: true,
36+
configurable: true,
37+
value: ResizeObserverMock,
38+
});
39+
});
2540
it('tests that the component loads web chat', async () => {
2641
const component = <WebChatContainer config={TEST_INSTANCE_CONFIG} />;
2742
const { findAllByPlaceholderText } = render(component);

0 commit comments

Comments
 (0)