1- import { act , renderHook } from '@testing-library/react-hooks ' ;
1+ import { act , renderHook } from '@testing-library/react' ;
22import * as React from 'react' ;
33
44import { IntercomProvider , useIntercom } from '../src' ;
@@ -8,10 +8,7 @@ const intercomAppId = config.intercomAppId;
88
99describe ( 'useIntercom' , ( ) => {
1010 test ( 'should be available when wrapped in context' , ( ) => {
11- const { result } = renderHook <
12- { children : React . ReactNode } ,
13- ReturnType < typeof useIntercom >
14- > ( ( ) => useIntercom ( ) , {
11+ const { result } = renderHook ( ( ) => useIntercom ( ) , {
1512 wrapper : ( { children } ) => (
1613 < IntercomProvider appId = { intercomAppId } > { children } </ IntercomProvider >
1714 ) ,
@@ -25,10 +22,7 @@ describe('useIntercom', () => {
2522 } ) ;
2623
2724 test ( 'should set `window.intercomSettings.appId` on boot' , ( ) => {
28- const { result } = renderHook <
29- { children : React . ReactNode } ,
30- ReturnType < typeof useIntercom >
31- > ( ( ) => useIntercom ( ) , {
25+ const { result } = renderHook ( ( ) => useIntercom ( ) , {
3226 wrapper : ( { children } ) => (
3327 < IntercomProvider appId = { intercomAppId } > { children } </ IntercomProvider >
3428 ) ,
@@ -46,10 +40,7 @@ describe('useIntercom', () => {
4640 test . skip ( 'should await a certain amount on delayed initialization' , async ( ) => {
4741 const onShow = jest . fn ( ) ;
4842
49- const { result } = renderHook <
50- { children : React . ReactNode } ,
51- ReturnType < typeof useIntercom >
52- > ( ( ) => useIntercom ( ) , {
43+ const { result } = renderHook ( ( ) => useIntercom ( ) , {
5344 wrapper : ( { children } ) => (
5445 < IntercomProvider
5546 appId = { intercomAppId }
@@ -71,10 +62,7 @@ describe('useIntercom', () => {
7162 } ) ;
7263
7364 it ( 'should remove `window.intercomSettings` on shutdown' , ( ) => {
74- const { result } = renderHook <
75- { children : React . ReactNode } ,
76- ReturnType < typeof useIntercom >
77- > ( ( ) => useIntercom ( ) , {
65+ const { result } = renderHook ( ( ) => useIntercom ( ) , {
7866 wrapper : ( { children } ) => (
7967 < IntercomProvider appId = { intercomAppId } > { children } </ IntercomProvider >
8068 ) ,
0 commit comments