-
Notifications
You must be signed in to change notification settings - Fork 556
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #740 from auth0/fix-configuration-url
Fix how the tenant and client info url is build to avoid format issues
- Loading branch information
Showing
4 changed files
with
67 additions
and
4 deletions.
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
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
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
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,60 @@ | ||
"use strict"; | ||
import { stub } from 'sinon'; | ||
|
||
import expect from 'expect.js'; | ||
|
||
import {extractTenantBaseUrlOption} from '../src/core/index'; | ||
|
||
describe("extractTenantBaseUrlOption", () => { | ||
|
||
it('should return the configurationBaseUrl', () => { | ||
|
||
var url = extractTenantBaseUrlOption({ | ||
configurationBaseUrl: 'https://test.com' | ||
}, 'me.auth0.com'); | ||
|
||
expect(url).to.be('https://test.com') | ||
|
||
}); | ||
|
||
it('should return the assetsUrl', () => { | ||
|
||
var url = extractTenantBaseUrlOption({ | ||
assetsUrl: 'https://test.com' | ||
}, 'me.auth0.com'); | ||
|
||
expect(url).to.be('https://test.com') | ||
|
||
}); | ||
|
||
it('should return the cdn url', () => { | ||
|
||
var url = extractTenantBaseUrlOption({ | ||
|
||
}, 'me.auth0.com'); | ||
|
||
expect(url).to.be('https://cdn.auth0.com/tenants/v1/me.js') | ||
|
||
}); | ||
|
||
it('should return the regionalized cdn url', () => { | ||
|
||
var url = extractTenantBaseUrlOption({ | ||
|
||
}, 'me.eu.auth0.com'); | ||
|
||
expect(url).to.be('https://cdn.eu.auth0.com/tenants/v1/me.js') | ||
|
||
}); | ||
|
||
it('should return the instance url', () => { | ||
|
||
var url = extractTenantBaseUrlOption({ | ||
|
||
}, 'auth.random.com'); | ||
|
||
expect(url).to.be('https://auth.random.com/tenants/v1/auth.js') | ||
|
||
}); | ||
|
||
}); |