Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NAS-133818 / 25.04-BETA.1 / Update system version utils for new naming (by denysbutenko) #11432

Merged
merged 8 commits into from
Feb 7, 2025
1 change: 1 addition & 0 deletions src/app/enums/codename.enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ export enum Codename {
ElectricEel = 'ElectricEel',
Dragonfish = 'Dragonfish',
Fangtooth = 'Fangtooth',
Goldeye = 'Goldeye',
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import {

describe('getSystemVersion', () => {
it('should return the correct system version when valid input is provided', () => {
expect(getSystemVersion('TrueNAS-SCALE-24.10.0-MASTER-20240301-233006', Codename.ElectricEel)).toBe(
'ElectricEel-24.10.0-MASTER-20240301-233006',
expect(getSystemVersion('TrueNAS-COMMUNITY_EDITION-25.10.0-MASTER-20250126-184805', Codename.Goldeye)).toBe(
'Goldeye-25.10.0-MASTER-20250126-184805',
);
});

it('should initial version if second argument is skipped', () => {
expect(getSystemVersion('TrueNAS-SCALE-24.10.0-MASTER-20240301-233006')).toBe(
'TrueNAS-SCALE-24.10.0-MASTER-20240301-233006',
expect(getSystemVersion('TrueNAS-COMMUNITY_EDITION-25.10.0-MASTER-20250126-184805')).toBe(
'TrueNAS-COMMUNITY_EDITION-25.10.0-MASTER-20250126-184805',
);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function getProductEnclosure(systemProduct: string): ProductEnclosure | n

export function getSystemVersion(version: string, codename?: Codename): string {
if (codename) {
return version.replace('TrueNAS-SCALE', codename);
return version.replace('TrueNAS-COMMUNITY_EDITION', codename);
}
return version;
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ describe('WidgetSysInfoActiveComponent', () => {

const systemInfo = {
platform: 'TRUENAS-M40-HA',
version: 'TrueNAS-SCALE-24.10.0-MASTER-20240301-233006',
codename: Codename.ElectricEel,
version: 'TrueNAS-COMMUNITY_EDITION-25.10.0-MASTER-20250126-184805',
codename: Codename.Goldeye,
license: {
contract_type: ContractType.Gold,
contract_end: {
Expand Down Expand Up @@ -121,7 +121,7 @@ describe('WidgetSysInfoActiveComponent', () => {
const items = await parallel(() => matListItems.map((item) => item.getFullText()));
expect(items).toEqual([
'Platform: TRUENAS-M40-HA',
'Version: ElectricEel-24.10.0-MASTER-20240301-233006',
'Version: Goldeye-25.10.0-MASTER-20250126-184805',
'Support License: Gold Contract, Expires on 2025-01-01',
'System Serial: AA-00001',
'Hostname: test-hostname-a',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ describe('WidgetSysInfoPassiveComponent', () => {
const systemInfo = {
remote_info: {
platform: 'TRUENAS-M40-HA',
version: 'TrueNAS-SCALE-24.10.0-MASTER-20240301-233006',
codename: Codename.ElectricEel,
version: 'TrueNAS-COMMUNITY_EDITION-25.10.0-MASTER-20250126-184805',
codename: Codename.Goldeye,
license: {
contract_type: ContractType.Gold,
contract_end: {
Expand Down Expand Up @@ -132,7 +132,7 @@ describe('WidgetSysInfoPassiveComponent', () => {
const items = await parallel(() => matListItems.map((item) => item.getFullText()));
expect(items).toEqual([
'Platform: TRUENAS-M40-HA',
'Version: ElectricEel-24.10.0-MASTER-20240301-233006',
'Version: Goldeye-25.10.0-MASTER-20250126-184805',
'Support License: Gold Contract, Expires on 2025-01-01',
'System Serial: AA-00002',
'Hostname: test-hostname-b',
Expand Down
Loading