[MM-22648] basic auth external sites (#1295)
* fix not using babel * wip * added tests, moved to map, polifill-like to convert between object and map * basic structure setup * working, found new bug * change buttons * fix login issue * remove logging code * address CR comments * remove custom function in favor of airbnb shim * fix linting * fix PM requested changes * [MM-25323] fix basic auth cancelling * fix crash when multiple request were made * address UX comments, added external link for user convenience
This commit is contained in:
@@ -92,4 +92,16 @@ describe('Utils', () => {
|
||||
assert.equal(Utils.isInternalURL(targetURL, currentURL, basename), true);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getHost', () => {
|
||||
it('should return the origin of a well formed url', () => {
|
||||
const myurl = 'https://mattermost.com/download';
|
||||
assert.equal(Utils.getHost(myurl), 'https://mattermost.com');
|
||||
});
|
||||
|
||||
it('shoud raise an error on malformed urls', () => {
|
||||
const myurl = 'http://example.com:-80/';
|
||||
assert.throws(() => Utils.getHost(myurl), Error);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user