mirror of
https://github.com/immich-app/immich.git
synced 2026-04-19 17:08:48 -04:00
* fix: user-agent format * ci: fix static analysis --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
30 lines
1.0 KiB
TypeScript
30 lines
1.0 KiB
TypeScript
import { getAppVersionFromUA } from 'src/utils/request';
|
|
|
|
describe(getAppVersionFromUA.name, () => {
|
|
it('should get the app version for android', () => {
|
|
expect(getAppVersionFromUA('immich-android/1.123.4')).toEqual('1.123.4');
|
|
});
|
|
|
|
it('should get the app version for ios', () => {
|
|
expect(getAppVersionFromUA('immich-ios/1.123.4')).toEqual('1.123.4');
|
|
});
|
|
|
|
it('should get the app version for unknown', () => {
|
|
expect(getAppVersionFromUA('immich-unknown/1.123.4')).toEqual('1.123.4');
|
|
});
|
|
|
|
describe('legacy format', () => {
|
|
it('should get the app version from the old android format', () => {
|
|
expect(getAppVersionFromUA('Immich_Android_1.123.4')).toEqual('1.123.4');
|
|
});
|
|
|
|
it('should get the app version from the old ios format', () => {
|
|
expect(getAppVersionFromUA('Immich_iOS_1.123.4')).toEqual('1.123.4');
|
|
});
|
|
|
|
it('should get the app version from the old unknown format', () => {
|
|
expect(getAppVersionFromUA('Immich_Unknown_1.123.4')).toEqual('1.123.4');
|
|
});
|
|
});
|
|
});
|