Skip to content

Commit cb36566

Browse files
authored
chore(clerk-js): Add snapshot test for PublicUserData (#4782)
1 parent dfdf23b commit cb36566

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

.changeset/stale-cougars-roll.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { PublicUserData } from '../PublicUserData';
2+
3+
describe('PublicUserData', () => {
4+
it('JSON.stringify returns the same object structure', () => {
5+
const pud = new PublicUserData({
6+
object: 'public_user_data',
7+
id: '123',
8+
first_name: 'John',
9+
last_name: 'Doe',
10+
image_url: 'https://example.com/image.jpg',
11+
has_image: true,
12+
identifier: 'john-doe',
13+
user_id: '123',
14+
});
15+
16+
expect(JSON.stringify(pud)).toMatchSnapshot();
17+
});
18+
});
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`PublicUserData JSON.stringify returns the same object structure 1`] = `"{"firstName":"John","lastName":"Doe","imageUrl":"https://example.com/image.jpg","hasImage":true,"identifier":"john-doe","userId":"123"}"`;

0 commit comments

Comments
 (0)