Skip to content

Commit

Permalink
chore(clerk-js): Add snapshot test for PublicUserData (#4782)
Browse files Browse the repository at this point in the history
  • Loading branch information
anagstef authored Dec 16, 2024
1 parent dfdf23b commit cb36566
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .changeset/stale-cougars-roll.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { PublicUserData } from '../PublicUserData';

describe('PublicUserData', () => {
it('JSON.stringify returns the same object structure', () => {
const pud = new PublicUserData({
object: 'public_user_data',
id: '123',
first_name: 'John',
last_name: 'Doe',
image_url: 'https://example.com/image.jpg',
has_image: true,
identifier: 'john-doe',
user_id: '123',
});

expect(JSON.stringify(pud)).toMatchSnapshot();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

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 comments on commit cb36566

Please sign in to comment.