Skip to content

Commit

Permalink
fix(shared): Remove invalid staging suffix
Browse files Browse the repository at this point in the history
  • Loading branch information
desiprisg committed Oct 30, 2023
1 parent 7f31f93 commit 86133f1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/shared/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ export const DEV_SUFFIXES = [
'.stg.lclclerk.com',
];

export const STAGING_SUFFIXES = ['.stg.dev', '.stgstage.dev', 'accountsstage.dev', 'accounts.dev'];
export const STAGING_SUFFIXES = ['.stg.dev', '.stgstage.dev', 'accountsstage.dev'];

export const DEV_OR_STAGING_SUFFIXES = [...DEV_SUFFIXES, ...STAGING_SUFFIXES];
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');
});
});

0 comments on commit 86133f1

Please sign in to comment.