Skip to content

Commit 4cbd43a

Browse files
committed
Merge branch 'main' into pr/stefanoCrmg/648-2
2 parents 8eebbed + a670eff commit 4cbd43a

11 files changed

Lines changed: 255 additions & 294 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Install pnpm
1919
uses: pnpm/action-setup@v2
2020
with:
21-
version: 7
21+
version: 8.6.5
2222

2323
- name: Use Node ${{ matrix.node-version }}
2424
uses: actions/setup-node@v3

.github/workflows/e2e-testing.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Install pnpm
1515
uses: pnpm/action-setup@v2
1616
with:
17-
version: 7
17+
version: 8.6.5
1818

1919
- name: Use Node ${{ matrix.node-version }}
2020
uses: actions/setup-node@v3

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Install pnpm
1515
uses: pnpm/action-setup@v2
1616
with:
17-
version: 7
17+
version: 8.6.5
1818

1919
- name: Use Node ${{ matrix.node-version }}
2020
uses: actions/setup-node@v3

.github/workflows/pull-request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Install pnpm
1515
uses: pnpm/action-setup@v2
1616
with:
17-
version: 7
17+
version: 8.6.5
1818

1919
- name: Use Node ${{ matrix.node-version }}
2020
uses: actions/setup-node@v3

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Install pnpm
2323
uses: pnpm/action-setup@v2
2424
with:
25-
version: 7
25+
version: 8.6.5
2626

2727
- name: Use Node ${{ matrix.node-version }}
2828
uses: actions/setup-node@v3

apps/examples/nextjs/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
"start": "next start"
88
},
99
"dependencies": {
10-
"next": "12.1.0",
11-
"react": "17.0.1",
12-
"react-dom": "17.0.1",
10+
"next": "13.4.7",
11+
"react": "^18.2.0",
12+
"react-dom": "^18.2.0",
1313
"react-use-intercom": "workspace:*"
1414
}
1515
}

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
22
"private": true,
3-
"packageManager": "pnpm@7.26.3",
3+
"packageManager": "pnpm@8.6.5",
4+
"engines": {
5+
"pnpm": "^8.0.0"
6+
},
47
"scripts": {
58
"dev": "turbo run dev --parallel --filter=playground --filter=react-use-intercom",
69
"dev:examples": "turbo run dev --parallel --filter=*-example --filter=react-use-intercom",

packages/react-use-intercom/package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,18 +69,17 @@
6969
},
7070
"devDependencies": {
7171
"@size-limit/preset-small-lib": "^7.0.3",
72-
"@testing-library/react": "^13.4.0",
73-
"@testing-library/react-hooks": "^8.0.1",
72+
"@testing-library/react": "^14.0.0",
7473
"@types/jest": "^27.5.2",
7574
"@types/node": "^18.11.19",
76-
"@types/react": "^18.0.20",
77-
"@types/react-dom": "^18.0.6",
75+
"@types/react": "^18.2.14",
76+
"@types/react-dom": "^18.2.6",
7877
"eslint-plugin-simple-import-sort": "^10.0.0",
7978
"jest": "^29.4.1",
8079
"jest-environment-jsdom": "^29.4.1",
8180
"react": "^18.2.0",
8281
"react-dom": "^18.2.0",
83-
"react-test-renderer": "^18.0.0",
82+
"react-test-renderer": "^18.2.0",
8483
"size-limit": "^7.0.3",
8584
"source-map": "0.6.1",
8685
"ts-jest": "^29.0.5",

packages/react-use-intercom/test/intercomProvider.test.tsx

Lines changed: 23 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { act, render } from '@testing-library/react';
2-
import { renderHook } from '@testing-library/react-hooks';
1+
import { act, render, renderHook } from '@testing-library/react';
32
import * as React from 'react';
43

54
import { IntercomProvider, useIntercom } from '../src';
@@ -31,27 +30,21 @@ describe('IntercomProvider', () => {
3130
test('should not call `onShow` callback when not calling `show`', () => {
3231
const mockOnShow = jest.fn();
3332

34-
renderHook<{ children: React.ReactNode }, ReturnType<typeof useIntercom>>(
35-
() => useIntercom(),
36-
{
37-
wrapper: ({ children }) => (
38-
<IntercomProvider appId={intercomAppId} onShow={mockOnShow} autoBoot>
39-
{children}
40-
</IntercomProvider>
41-
),
42-
},
43-
);
33+
renderHook(() => useIntercom(), {
34+
wrapper: ({ children }) => (
35+
<IntercomProvider appId={intercomAppId} onShow={mockOnShow} autoBoot>
36+
{children}
37+
</IntercomProvider>
38+
),
39+
});
4440

4541
expect(mockOnShow).not.toBeCalled();
4642
});
4743

4844
test('should set `window.intercomSettings.apiBase` on autoBoot', () => {
4945
const apiBase = `https://${intercomAppId}.intercom-messenger.com`;
5046

51-
const { result } = renderHook<
52-
{ children: React.ReactNode },
53-
ReturnType<typeof useIntercom>
54-
>(() => useIntercom(), {
47+
const { result } = renderHook(() => useIntercom(), {
5548
wrapper: ({ children }) => (
5649
<IntercomProvider appId={intercomAppId} apiBase={apiBase}>
5750
{children}
@@ -74,22 +67,19 @@ describe('IntercomProvider', () => {
7467
test('should pass props when `autoBootProps` is passed', () => {
7568
const phone = '123456';
7669

77-
renderHook<{ children: React.ReactNode }, ReturnType<typeof useIntercom>>(
78-
() => useIntercom(),
79-
{
80-
wrapper: ({ children }) => (
81-
<IntercomProvider
82-
appId={intercomAppId}
83-
autoBootProps={{
84-
phone,
85-
}}
86-
autoBoot
87-
>
88-
{children}
89-
</IntercomProvider>
90-
),
91-
},
92-
);
70+
renderHook(() => useIntercom(), {
71+
wrapper: ({ children }) => (
72+
<IntercomProvider
73+
appId={intercomAppId}
74+
autoBootProps={{
75+
phone,
76+
}}
77+
autoBoot
78+
>
79+
{children}
80+
</IntercomProvider>
81+
),
82+
});
9383

9484
expect(window.intercomSettings).toEqual({
9585
app_id: intercomAppId,
@@ -100,10 +90,7 @@ describe('IntercomProvider', () => {
10090
test('should not pass props when `autoBootProps` is passed and `autoBoot` is `false`', () => {
10191
const phone = '123456';
10292

103-
const { result } = renderHook<
104-
{ children: React.ReactNode },
105-
ReturnType<typeof useIntercom>
106-
>(() => useIntercom(), {
93+
const { result } = renderHook(() => useIntercom(), {
10794
wrapper: ({ children }) => (
10895
<IntercomProvider
10996
appId={intercomAppId}

packages/react-use-intercom/test/useIntercom.test.tsx

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { act, renderHook } from '@testing-library/react-hooks';
1+
import { act, renderHook } from '@testing-library/react';
22
import * as React from 'react';
33

44
import { IntercomProvider, useIntercom } from '../src';
@@ -8,10 +8,7 @@ const intercomAppId = config.intercomAppId;
88

99
describe('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

Comments
 (0)