Skip to content

Commit

Permalink
test(clerk-js): Create snapshot test for OrganizationDomain
Browse files Browse the repository at this point in the history
  • Loading branch information
panteliselef committed Aug 9, 2023
1 parent eccf1a8 commit 87cd7b7
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 0 deletions.
40 changes: 40 additions & 0 deletions packages/clerk-js/src/core/resources/OrganizationDomain.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { OrganizationDomain } from './internal';

describe('OrganizationDomain', () => {
it('has the same initial properties', () => {
const organization = new OrganizationDomain({
object: 'organization_domain',
id: 'test_domain_id',
name: 'clerk.dev',
organization_id: 'test_org_id',
enrollment_mode: 'manual_invitation',
verification: {
attempts: 1,
expires_at: 12345,
strategy: 'email_code',
status: 'verified',
},
affiliation_email_address: 'some@clerk.dev',
created_at: 12345,
updated_at: 5678,
});

expect(organization).toMatchSnapshot();
});

it('has the same initial nullable properties', () => {
const organization = new OrganizationDomain({
object: 'organization_domain',
id: 'test_domain_id',
name: 'clerk.dev',
organization_id: 'test_org_id',
enrollment_mode: 'manual_invitation',
verification: null,
affiliation_email_address: null,
created_at: 12345,
updated_at: 5678,
});

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

exports[`OrganizationDomain has the same initial nullable properties 1`] = `
OrganizationDomain {
"affiliationEmailAddress": null,
"attemptAffiliationVerification": [Function],
"delete": [Function],
"enrollmentMode": "manual_invitation",
"id": "test_domain_id",
"name": "clerk.dev",
"organizationId": "test_org_id",
"pathRoot": "",
"prepareDomainAffiliationVerification": [Function],
"update": [Function],
"verification": null,
}
`;

exports[`OrganizationDomain has the same initial properties 1`] = `
OrganizationDomain {
"affiliationEmailAddress": "some@clerk.dev",
"attemptAffiliationVerification": [Function],
"delete": [Function],
"enrollmentMode": "manual_invitation",
"id": "test_domain_id",
"name": "clerk.dev",
"organizationId": "test_org_id",
"pathRoot": "",
"prepareDomainAffiliationVerification": [Function],
"update": [Function],
"verification": {
"attempts": 1,
"expiresAt": 1970-01-01T00:00:12.345Z,
"status": "verified",
"strategy": "email_code",
},
}
`;

0 comments on commit 87cd7b7

Please sign in to comment.