Skip to content

Commit

Permalink
Merge pull request #21 from the-bugging/develop
Browse files Browse the repository at this point in the history
fix: type for identifyHotjar userId arg
  • Loading branch information
olavoparno committed Jan 16, 2024
2 parents 39ae16b + 40f5606 commit 185e349
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 10 deletions.
12 changes: 11 additions & 1 deletion .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: [the-bugging]
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,16 +151,17 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<table>
<tbody>
<tr>
<td align="center"><a href="https://olavoparno.github.io"><img src="https://avatars1.githubusercontent.com/u/7513162?v=4?s=70" width="70px;" alt="Olavo Parno"/><br /><sub><b>Olavo Parno</b></sub></a><br /><a href="#ideas-olavoparno" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/the-bugging/react-use-hotjar/commits?author=olavoparno" title="Code">💻</a> <a href="https://github.com/the-bugging/react-use-hotjar/commits?author=olavoparno" title="Tests">⚠️</a></td>
<td align="center"><a href="https://github.com/gianpietro1"><img src="https://avatars.githubusercontent.com/u/10046142?v=4?s=70" width="70px;" alt="Gianpietro Lavado"/><br /><sub><b>Gianpietro Lavado</b></sub></a><br /><a href="https://github.com/the-bugging/react-use-hotjar/commits?author=gianpietro1" title="Documentation">📖</a></td>
<td align="center"><a href="https://paqmind.com"><img src="https://avatars.githubusercontent.com/u/2128182?v=4?s=70" width="70px;" alt="Ivan Kleshnin"/><br /><sub><b>Ivan Kleshnin</b></sub></a><br /><a href="https://github.com/the-bugging/react-use-hotjar/commits?author=ivan-kleshnin" title="Code">💻</a> <a href="#ideas-ivan-kleshnin" title="Ideas, Planning, & Feedback">🤔</a></td>
<td align="center"><a href="https://ajayvarghese.netlify.app/"><img src="https://avatars.githubusercontent.com/u/12490903?v=4?s=70" width="70px;" alt="Ajay Varghese"/><br /><sub><b>Ajay Varghese</b></sub></a><br /><a href="https://github.com/the-bugging/react-use-hotjar/commits?author=ajayvarghese" title="Code">💻</a> <a href="#ideas-ajayvarghese" title="Ideas, Planning, & Feedback">🤔</a></td>
<td align="center"><a href="https://github.com/honicole"><img src="https://avatars.githubusercontent.com/u/11463889?v=4?s=70" width="70px;" alt="honicole"/><br /><sub><b>honicole</b></sub></a><br /><a href="#tool-honicole" title="Tools">🔧</a> <a href="https://github.com/the-bugging/react-use-hotjar/commits?author=honicole" title="Code">💻</a> <a href="#ideas-honicole" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/the-bugging/react-use-hotjar/commits?author=honicole" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/georgibakken"><img src="https://avatars.githubusercontent.com/u/16558100?v=4?s=70" width="70px;" alt="Georg Bakken Idland"/><br /><sub><b>Georg Bakken Idland</b></sub></a><br /><a href="https://github.com/the-bugging/react-use-hotjar/commits?author=georgibakken" title="Documentation">📖</a> <a href="#ideas-georgibakken" title="Ideas, Planning, & Feedback">🤔</a></td>
<td align="center"><a href="https://github.com/vith"><img src="https://avatars.githubusercontent.com/u/3265539?v=4?s=70" width="70px;" alt="Jason Papakostas"/><br /><sub><b>Jason Papakostas</b></sub></a><br /><a href="https://github.com/the-bugging/react-use-hotjar/issues?q=author%3Avith" title="Bug reports">🐛</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://olavoparno.github.io"><img src="https://avatars1.githubusercontent.com/u/7513162?v=4?s=70" width="70px;" alt="Olavo Parno"/><br /><sub><b>Olavo Parno</b></sub></a><br /><a href="#ideas-olavoparno" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/the-bugging/react-use-hotjar/commits?author=olavoparno" title="Code">💻</a> <a href="https://github.com/the-bugging/react-use-hotjar/commits?author=olavoparno" title="Tests">⚠️</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/gianpietro1"><img src="https://avatars.githubusercontent.com/u/10046142?v=4?s=70" width="70px;" alt="Gianpietro Lavado"/><br /><sub><b>Gianpietro Lavado</b></sub></a><br /><a href="https://github.com/the-bugging/react-use-hotjar/commits?author=gianpietro1" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://paqmind.com"><img src="https://avatars.githubusercontent.com/u/2128182?v=4?s=70" width="70px;" alt="Ivan Kleshnin"/><br /><sub><b>Ivan Kleshnin</b></sub></a><br /><a href="https://github.com/the-bugging/react-use-hotjar/commits?author=ivan-kleshnin" title="Code">💻</a> <a href="#ideas-ivan-kleshnin" title="Ideas, Planning, & Feedback">🤔</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://ajayvarghese.netlify.app/"><img src="https://avatars.githubusercontent.com/u/12490903?v=4?s=70" width="70px;" alt="Ajay Varghese"/><br /><sub><b>Ajay Varghese</b></sub></a><br /><a href="https://github.com/the-bugging/react-use-hotjar/commits?author=ajayvarghese" title="Code">💻</a> <a href="#ideas-ajayvarghese" title="Ideas, Planning, & Feedback">🤔</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/honicole"><img src="https://avatars.githubusercontent.com/u/11463889?v=4?s=70" width="70px;" alt="honicole"/><br /><sub><b>honicole</b></sub></a><br /><a href="#tool-honicole" title="Tools">🔧</a> <a href="https://github.com/the-bugging/react-use-hotjar/commits?author=honicole" title="Code">💻</a> <a href="#ideas-honicole" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/the-bugging/react-use-hotjar/commits?author=honicole" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/georgibakken"><img src="https://avatars.githubusercontent.com/u/16558100?v=4?s=70" width="70px;" alt="Georg Bakken Idland"/><br /><sub><b>Georg Bakken Idland</b></sub></a><br /><a href="https://github.com/the-bugging/react-use-hotjar/commits?author=georgibakken" title="Documentation">📖</a> <a href="#ideas-georgibakken" title="Ideas, Planning, & Feedback">🤔</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/vith"><img src="https://avatars.githubusercontent.com/u/3265539?v=4?s=70" width="70px;" alt="Jason Papakostas"/><br /><sub><b>Jason Papakostas</b></sub></a><br /><a href="https://github.com/the-bugging/react-use-hotjar/issues?q=author%3Avith" title="Bug reports">🐛</a></td>
</tr>
<tr>
<td align="center"><a href="https://luighiviton.com"><img src="https://avatars.githubusercontent.com/u/6945270?v=4?s=70" width="70px;" alt="Luighi Viton-Zorrilla"/><br /><sub><b>Luighi Viton-Zorrilla</b></sub></a><br /><a href="https://github.com/the-bugging/react-use-hotjar/issues?q=author%3ALuighiV" title="Bug reports">🐛</a> <a href="#maintenance-LuighiV" title="Maintenance">🚧</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://luighiviton.com"><img src="https://avatars.githubusercontent.com/u/6945270?v=4?s=70" width="70px;" alt="Luighi Viton-Zorrilla"/><br /><sub><b>Luighi Viton-Zorrilla</b></sub></a><br /><a href="https://github.com/the-bugging/react-use-hotjar/issues?q=author%3ALuighiV" title="Bug reports">🐛</a> <a href="#maintenance-LuighiV" title="Maintenance">🚧</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/quentin-luc-15161994/"><img src="https://avatars.githubusercontent.com/u/5237095?v=4?s=70" width="70px;" alt="Quentin Luc"/><br /><sub><b>Quentin Luc</b></sub></a><br /><a href="https://github.com/the-bugging/react-use-hotjar/commits?author=QuentinLuc" title="Code">💻</a></td>
</tr>
</tbody>
</table>
Expand Down
14 changes: 14 additions & 0 deletions src/__tests__/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 185e349

Please sign in to comment.