Skip to content

Commit 5272ef7

Browse files
authored
Add domain verification intent enum and test (#871)
## Description Add domain verification intent enum and test ## Documentation Does this require changes to the WorkOS Docs? E.g. the [API Reference](https://workos.com/docs/reference) or code snippets need updates. ``` [ ] Yes ``` If yes, link a related docs PR and add a docs maintainer as a reviewer. Their approval is required.
1 parent fc35bad commit 5272ef7

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

src/portal/interfaces/generate-portal-link-intent.interface.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
export enum GeneratePortalLinkIntent {
22
AuditLogs = 'audit_logs',
3+
DomainVerification = 'domain_verification',
34
DSync = 'dsync',
45
LogStreams = 'log_streams',
56
SSO = 'sso',

src/portal/portal.spec.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,28 @@ describe('Portal', () => {
3535
});
3636
});
3737

38+
describe('with the domain_verification intent', () => {
39+
it('returns an Admin Portal link', async () => {
40+
mock
41+
.onPost('/portal/generate_link', {
42+
intent: GeneratePortalLinkIntent.DomainVerification,
43+
organization: 'org_01EHQMYV6MBK39QC5PZXHY59C3',
44+
return_url: 'https://www.example.com',
45+
})
46+
.replyOnce(201, generateLink);
47+
48+
const { link } = await workos.portal.generateLink({
49+
intent: GeneratePortalLinkIntent.DomainVerification,
50+
organization: 'org_01EHQMYV6MBK39QC5PZXHY59C3',
51+
returnUrl: 'https://www.example.com',
52+
});
53+
54+
expect(link).toEqual(
55+
'https://id.workos.com/portal/launch?secret=secret',
56+
);
57+
});
58+
});
59+
3860
describe('with the dsync intent', () => {
3961
it('returns an Admin Portal link', async () => {
4062
mock

0 commit comments

Comments
 (0)