-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added shortcut for copying version info and added browser/os to…
… info (#1739) - Adds a shortcut for copying version info to clipboard to make it easier when making tickets. - Adds a new package for parsing UA strings - Adds browser/os to version info for copying
- Loading branch information
Showing
7 changed files
with
129 additions
and
9 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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