-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into app-dashboards
- Loading branch information
Showing
30 changed files
with
904 additions
and
377 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
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,51 @@ | ||
import { getFormattedVersionInfo } from './SettingsUtils'; | ||
|
||
describe('getFormattedVersionInfo', () => { | ||
it('should return the formatted version information', () => { | ||
const serverConfigValues = new Map<string, string>(); | ||
serverConfigValues.set('deephaven.version', '1.0.0'); | ||
serverConfigValues.set('java.version', '11.0.1'); | ||
serverConfigValues.set('barrage.version', '2.3.4'); | ||
|
||
Object.defineProperty(window, 'navigator', { | ||
value: { | ||
userAgent: | ||
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.93 Safari/537.36', | ||
}, | ||
writable: true, | ||
}); | ||
|
||
const result = getFormattedVersionInfo(serverConfigValues); | ||
|
||
expect(result).toEqual({ | ||
'Engine Version': '1.0.0', | ||
'Web UI Version': '0.0.1', | ||
'Java Version': '11.0.1', | ||
'Barrage Version': '2.3.4', | ||
'Browser Name': 'Chrome 96', | ||
'OS Name': 'Windows NT 10.0', | ||
}); | ||
}); | ||
|
||
it('should return "Unknown" for missing version information', () => { | ||
const serverConfigValues = new Map<string, string>(); | ||
|
||
Object.defineProperty(window, 'navigator', { | ||
value: { | ||
userAgent: 'Garbage User Agent String', | ||
}, | ||
writable: true, | ||
}); | ||
|
||
const result = getFormattedVersionInfo(serverConfigValues); | ||
|
||
expect(result).toEqual({ | ||
'Engine Version': 'Unknown', | ||
'Web UI Version': '0.0.1', | ||
'Java Version': 'Unknown', | ||
'Barrage Version': 'Unknown', | ||
'Browser Name': 'Unknown', | ||
'OS Name': 'Unknown', | ||
}); | ||
}); | ||
}); |
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
Oops, something went wrong.