import { ContentsquareModule } from '../../core/nativeModules'; import { injectWebView, removeWebViewInjection } from '../../webview/webView'; jest.mock('../../core/nativeModules', () => ({ ContentsquareModule: { injectWebView: jest.fn(), removeWebViewInjection: jest.fn(), }, })); describe('webViewUtils', () => { beforeEach(() => { jest.clearAllMocks(); }); describe('injectWebView', () => { it('should call ContentsquareModule.injectWebView with the correct webViewTag', () => { const webViewTag = 123; injectWebView(webViewTag); expect(ContentsquareModule.injectWebView).toHaveBeenCalledWith( webViewTag ); expect(ContentsquareModule.injectWebView).toHaveBeenCalledTimes(1); }); }); describe('removeWebViewInjection', () => { it('should call ContentsquareModule.removeWebViewInjection with the correct webViewTag', () => { const webViewTag = 456; removeWebViewInjection(webViewTag); expect(ContentsquareModule.removeWebViewInjection).toHaveBeenCalledWith( webViewTag ); expect(ContentsquareModule.removeWebViewInjection).toHaveBeenCalledTimes( 1 ); }); }); });