Skip to content

Commit

Permalink
NAS-132330: Update TrueNAS Brand
Browse files Browse the repository at this point in the history
  • Loading branch information
denysbutenko committed Jan 10, 2025
1 parent bfc0191 commit dfa0def
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/app/enums/product-type.enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ export enum ProductType {
}

export const productTypeLabels = new Map<ProductType, string>([
[ProductType.Scale, 'Community Edition'],
[ProductType.Scale, 'Community Edition'],
[ProductType.ScaleEnterprise, 'Enterprise'],
]);
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { createComponentFactory, Spectator } from '@ngneat/spectator/jest';
import { MockStore, provideMockStore } from '@ngrx/store/testing';
import { ProductType } from 'app/enums/product-type.enum';
import { CopyrightLineComponent } from 'app/modules/layout/copyright-line/copyright-line.component';
import { MapValuePipe } from 'app/modules/pipes/map-value/map-value.pipe';
import { AppState } from 'app/store';
import { selectBuildYear, selectIsEnterprise } from 'app/store/system-info/system-info.selectors';
import { selectBuildYear, selectProductType } from 'app/store/system-info/system-info.selectors';

describe('CopyrightLineComponent', () => {
let spectator: Spectator<CopyrightLineComponent>;
Expand All @@ -15,8 +16,8 @@ describe('CopyrightLineComponent', () => {
providers: [
provideMockStore({
selectors: [{
selector: selectIsEnterprise,
value: false,
selector: selectProductType,
value: ProductType.Scale,
}, {
selector: selectBuildYear,
value: 2024,
Expand All @@ -31,21 +32,21 @@ describe('CopyrightLineComponent', () => {
});

it('shows copyright line with product type and year of build', () => {
store$.overrideSelector(selectIsEnterprise, false);
store$.overrideSelector(selectProductType, ProductType.Scale);
store$.refreshState();
spectator.detectChanges();

expect(spectator.fixture.nativeElement).toHaveText('TrueNAS ® © 2024');
expect(spectator.fixture.nativeElement).toHaveText('TrueNAS Community Edition ® © 2024');
expect(spectator.fixture.nativeElement).toHaveText('iXsystems, Inc');
expect(spectator.query('a')).toHaveAttribute('href', 'https://truenas.com/testdrive');
});

it('shows copyright line with enterprise product type and year of build', () => {
store$.overrideSelector(selectIsEnterprise, true);
store$.overrideSelector(selectProductType, ProductType.ScaleEnterprise);
store$.refreshState();
spectator.detectChanges();

expect(spectator.fixture.nativeElement).toHaveText('TrueNAS ENTERPRISE ® © 2024');
expect(spectator.fixture.nativeElement).toHaveText('TrueNAS Enterprise ® © 2024');
expect(spectator.fixture.nativeElement).toHaveText('iXsystems, Inc');
expect(spectator.query('a')).toHaveAttribute('href', 'https://truenas.com/production');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
import { createComponentFactory, Spectator } from '@ngneat/spectator/jest';
import { MockStore, provideMockStore } from '@ngrx/store/testing';
import { MockComponent } from 'ng-mocks';
import { ProductType } from 'app/enums/product-type.enum';
import { helptextAbout } from 'app/helptext/about';
import { IxIconHarness } from 'app/modules/ix-icon/ix-icon.harness';
import { CopyrightLineComponent } from 'app/modules/layout/copyright-line/copyright-line.component';
import { SlotSize } from 'app/pages/dashboard/types/widget.interface';
import { WidgetHelpComponent } from 'app/pages/dashboard/widgets/help/widget-help/widget-help.component';
import { AppState } from 'app/store';
import { selectIsEnterprise } from 'app/store/system-info/system-info.selectors';
import { selectIsEnterprise, selectProductType } from 'app/store/system-info/system-info.selectors';

describe('WidgetHelpComponent', () => {
let spectator: Spectator<WidgetHelpComponent>;
Expand All @@ -24,8 +25,8 @@ describe('WidgetHelpComponent', () => {
providers: [
provideMockStore({
selectors: [{
selector: selectIsEnterprise,
value: false,
selector: selectProductType,
value: ProductType.Scale,
}],
}),
],
Expand Down Expand Up @@ -138,7 +139,7 @@ describe('WidgetHelpComponent', () => {
});

it('checks open source row', () => {
expect(spectator.query('.open-source')).toHaveText('TrueNAS is Free');
expect(spectator.query('.open-source')).toHaveText('TrueNAS Community Edition is Free');

store$.overrideSelector(selectIsEnterprise, true);
store$.refreshState();
Expand Down

0 comments on commit dfa0def

Please sign in to comment.