diff --git a/.all-contributorsrc b/.all-contributorsrc index d41f4fc..d202369 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -89,9 +89,19 @@ "bug", "maintenance" ] + }, + { + "login": "QuentinLuc", + "name": "Quentin Luc", + "avatar_url": "https://avatars.githubusercontent.com/u/5237095?v=4", + "profile": "https://www.linkedin.com/in/quentin-luc-15161994/", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, "skipCi": true, - "commitConvention": "angular" + "commitConvention": "angular", + "commitType": "docs" } diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..a28b775 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +github: [the-bugging] diff --git a/README.md b/README.md index c604e99..852c7dc 100644 --- a/README.md +++ b/README.md @@ -151,16 +151,17 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d - - - - - - - + + + + + + + - + +
Olavo Parno
Olavo Parno

🤔 💻 ⚠️
Gianpietro Lavado
Gianpietro Lavado

📖
Ivan Kleshnin
Ivan Kleshnin

💻 🤔
Ajay Varghese
Ajay Varghese

💻 🤔
honicole
honicole

🔧 💻 🤔 📖
Georg Bakken Idland
Georg Bakken Idland

📖 🤔
Jason Papakostas
Jason Papakostas

🐛
Olavo Parno
Olavo Parno

🤔 💻 ⚠️
Gianpietro Lavado
Gianpietro Lavado

📖
Ivan Kleshnin
Ivan Kleshnin

💻 🤔
Ajay Varghese
Ajay Varghese

💻 🤔
honicole
honicole

🔧 💻 🤔 📖
Georg Bakken Idland
Georg Bakken Idland

📖 🤔
Jason Papakostas
Jason Papakostas

🐛
Luighi Viton-Zorrilla
Luighi Viton-Zorrilla

🐛 🚧
Luighi Viton-Zorrilla
Luighi Viton-Zorrilla

🐛 🚧
Quentin Luc
Quentin Luc

💻
diff --git a/src/__tests__/index.test.ts b/src/__tests__/index.test.ts index 3f9a330..a0094d0 100644 --- a/src/__tests__/index.test.ts +++ b/src/__tests__/index.test.ts @@ -68,6 +68,20 @@ describe('Tests useHotjar', () => { }); }); + it('should identifyHotjar for De-identified users', () => { + const { result } = renderHook(() => useHotjar()); + const identifyHotjarSpy = jest.spyOn(result.current, 'identifyHotjar'); + const { identifyHotjar } = result.current; + + identifyHotjar(null, { + ab_test: 'variant-A', + }); + + expect(identifyHotjarSpy).toHaveBeenCalledWith(null, { + ab_test: 'variant-A', + }); + }); + it('should stateChange with new relative path', () => { const { result } = renderHook(() => useHotjar()); const stateChangeSpy = jest.spyOn(result.current, 'stateChange'); diff --git a/src/types.ts b/src/types.ts index 305c118..dc67471 100644 --- a/src/types.ts +++ b/src/types.ts @@ -12,7 +12,7 @@ export interface IUseHotjar { logCallback?: (...data: unknown[]) => void ) => boolean; identifyHotjar: ( - userId: string, + userId: string | null, userInfo: TUserInfo, logCallback?: (...data: unknown[]) => void ) => boolean;