-
Notifications
You must be signed in to change notification settings - Fork 252
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(clerk-js): Create snapshot test for OrganizationDomain
- Loading branch information
1 parent
eccf1a8
commit 87cd7b7
Showing
2 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
packages/clerk-js/src/core/resources/OrganizationDomain.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}); | ||
}); |
38 changes: 38 additions & 0 deletions
38
packages/clerk-js/src/core/resources/__snapshots__/OrganizationDomain.test.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | ||
}, | ||
} | ||
`; |