forked from nebari-dev/jhub-apps
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BUG - JHubApp Launcher doesn't encode usernames, can lead to 404s (ne…
…bari-dev#241) * Fix url encoding for launching server. * Add new build.
- Loading branch information
Showing
4 changed files
with
80 additions
and
43 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -6,6 +6,7 @@ import { | |
filterAndSortApps, | ||
getAppLogoUrl, | ||
getApps, | ||
getEncodedServerUrl, | ||
getFriendlyDateStr, | ||
getFriendlyDisplayName, | ||
getFriendlyFrameworkName, | ||
|
@@ -51,10 +52,10 @@ describe('JupyterHub utils', () => { | |
const result = getServices(servicesFull, user); | ||
expect(result.length).toEqual(2); | ||
expect(result[0]).toEqual({ | ||
name: 'Service 1', | ||
url: 'http://service1.com/testUser', | ||
name: 'Environments', | ||
url: 'http://service1.com/service1', | ||
external: true, | ||
pinned: false, | ||
pinned: true, | ||
}); | ||
}); | ||
|
||
|
@@ -80,6 +81,26 @@ describe('JupyterHub utils', () => { | |
expect(result.length).toEqual(5); | ||
}); | ||
|
||
test('returns a jupyterhub friendly url for JupyterLab with no encoding needed', () => { | ||
const result = getEncodedServerUrl('testuser', 'lab'); | ||
expect(result).toBe('/hub/user/testuser/lab'); | ||
}); | ||
|
||
test('returns a jupyterhub friendly url for JupyterLab with encoding needed', () => { | ||
const result = getEncodedServerUrl('[email protected]', 'lab'); | ||
expect(result).toBe('/hub/user/testuser%[email protected]/lab'); | ||
}); | ||
|
||
test('returns a jupyterhub friendly url for VSCode with no encoding needed', () => { | ||
const result = getEncodedServerUrl('testuser', 'vscode'); | ||
expect(result).toBe('/hub/user/testuser/vscode'); | ||
}); | ||
|
||
test('returns a jupyterhub friendly url for VSCode with encoding needed', () => { | ||
const result = getEncodedServerUrl('[email protected]', 'vscode'); | ||
expect(result).toBe('/hub/user/testuser%[email protected]/vscode'); | ||
}); | ||
|
||
test('returns a friendly display name with no trailing spaces', () => { | ||
const result = getFriendlyDisplayName('Test App 1 '); | ||
expect(result).toBe('Test App 1'); | ||
|
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