-
Notifications
You must be signed in to change notification settings - Fork 253
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(shared): Remove invalid staging suffix
- Loading branch information
Showing
2 changed files
with
19 additions
and
1 deletion.
There are no files selected for viewing
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
18 changes: 18 additions & 0 deletions
18
packages/shared/src/utils/__tests__/apiUrlFromPublishableKey.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,18 @@ | ||
import { apiUrlFromPublishableKey } from '../apiUrlFromPublishableKey'; | ||
|
||
describe('apiUrlFromPublishableKey', () => { | ||
test('returns the prod api url when given a prod publishable key', async () => { | ||
const apiUrl = apiUrlFromPublishableKey('pk_test_bWFueS1zZWFsLTkwLmNsZXJrLmFjY291bnRzLmRldiQ'); | ||
expect(apiUrl).toBe('https://api.clerk.com'); | ||
}); | ||
|
||
test('returns the prod api url when given a staging publishable key', async () => { | ||
const apiUrl = apiUrlFromPublishableKey('pk_test_aW1tdW5lLWhhd2stNjUuY2xlcmsuYWNjb3VudHNzdGFnZS5kZXYk'); | ||
expect(apiUrl).toBe('https://api.clerkstage.dev'); | ||
}); | ||
|
||
test('returns the prod api url when given a local publishable key', async () => { | ||
const apiUrl = apiUrlFromPublishableKey('pk_test_cGF0aWVudC1nb29zZS01LmNsZXJrLmFjY291bnRzLmxjbGNsZXJrLmNvbSQ'); | ||
expect(apiUrl).toBe('https://api.lclclerk.com'); | ||
}); | ||
}); |