Skip to content

Commit

Permalink
Add domain verification intent enum and test (#871)
Browse files Browse the repository at this point in the history
## 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.
  • Loading branch information
jbvolta authored Nov 1, 2023
1 parent fc35bad commit 5272ef7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export enum GeneratePortalLinkIntent {
AuditLogs = 'audit_logs',
DomainVerification = 'domain_verification',
DSync = 'dsync',
LogStreams = 'log_streams',
SSO = 'sso',
Expand Down
22 changes: 22 additions & 0 deletions src/portal/portal.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,28 @@ describe('Portal', () => {
});
});

describe('with the domain_verification intent', () => {
it('returns an Admin Portal link', async () => {
mock
.onPost('/portal/generate_link', {
intent: GeneratePortalLinkIntent.DomainVerification,
organization: 'org_01EHQMYV6MBK39QC5PZXHY59C3',
return_url: 'https://www.example.com',
})
.replyOnce(201, generateLink);

const { link } = await workos.portal.generateLink({
intent: GeneratePortalLinkIntent.DomainVerification,
organization: 'org_01EHQMYV6MBK39QC5PZXHY59C3',
returnUrl: 'https://www.example.com',
});

expect(link).toEqual(
'https://id.workos.com/portal/launch?secret=secret',
);
});
});

describe('with the dsync intent', () => {
it('returns an Admin Portal link', async () => {
mock
Expand Down

0 comments on commit 5272ef7

Please sign in to comment.