-
Notifications
You must be signed in to change notification settings - Fork 321
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
337 changed files
with
9,065 additions
and
893 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -1,7 +1,17 @@ | ||
import { marker as T } from '@biesbjerg/ngx-translate-extract-marker'; | ||
|
||
export enum DirectoryServiceState { | ||
Disabled = 'DISABLED', | ||
Healthy = 'HEALTHY', | ||
Faulted = 'FAULTED', | ||
Leaving = 'LEAVING', | ||
Joining = 'JOINING', | ||
} | ||
|
||
export const directoryServiceStateLabels = new Map<DirectoryServiceState, string>([ | ||
[DirectoryServiceState.Disabled, T('Disabled')], | ||
[DirectoryServiceState.Healthy, T('Healthy')], | ||
[DirectoryServiceState.Faulted, T('Faulted')], | ||
[DirectoryServiceState.Leaving, T('Leaving')], | ||
[DirectoryServiceState.Joining, T('Joining')], | ||
]); |
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,15 @@ | ||
import { marker as T } from '@biesbjerg/ngx-translate-extract-marker'; | ||
|
||
export enum SmbEncryption { | ||
Default = 'DEFAULT', | ||
Negotiate = 'NEGOTIATE', | ||
Desired = 'DESIRED', | ||
Required = 'REQUIRED', | ||
} | ||
|
||
export const smbEncryptionLabels = new Map<SmbEncryption, string>([ | ||
[SmbEncryption.Default, T('Default – follow upstream / TrueNAS default')], | ||
[SmbEncryption.Negotiate, T('Negotiate – only encrypt transport if explicitly requested by the SMB client')], | ||
[SmbEncryption.Desired, T('Desired – encrypt transport if supported by client during session negotiation')], | ||
[SmbEncryption.Required, T('Required – always encrypt transport (rejecting access if client does not support encryption – incompatible with SMB1 server enable_smb1)')], | ||
]); |
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
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
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
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
89 changes: 89 additions & 0 deletions
89
...rms/components/ix-slide-in/components/ix-modal-header2/ix-modal-header2.component.spec.ts
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,89 @@ | ||
import { HarnessLoader } from '@angular/cdk/testing'; | ||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'; | ||
import { CommonModule } from '@angular/common'; | ||
import { MatButtonHarness } from '@angular/material/button/testing'; | ||
import { FlexLayoutModule } from '@ngbracket/ngx-layout'; | ||
import { mockProvider, Spectator, createComponentFactory } from '@ngneat/spectator/jest'; | ||
import { MockComponent } from 'ng-mocks'; | ||
import { Subject } from 'rxjs'; | ||
import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; | ||
import { ChainedRef } from 'app/modules/forms/ix-forms/components/ix-slide-in/chained-component-ref'; | ||
import { IxModalHeader2Component } from 'app/modules/forms/ix-forms/components/ix-slide-in/components/ix-modal-header2/ix-modal-header2.component'; | ||
import { IxIconComponent } from 'app/modules/ix-icon/ix-icon.component'; | ||
import { CloudBackupFormComponent } from 'app/pages/data-protection/cloud-backup/cloud-backup-form/cloud-backup-form.component'; | ||
import { CloudSyncWizardComponent } from 'app/pages/data-protection/cloudsync/cloudsync-wizard/cloudsync-wizard.component'; | ||
import { ChainedComponentResponse, ChainedComponentSerialized, IxChainedSlideInService } from 'app/services/ix-chained-slide-in.service'; | ||
|
||
describe('IxModalHeader2Component', () => { | ||
let spectator: Spectator<IxModalHeader2Component>; | ||
const components$ = new Subject<ChainedComponentSerialized[]>(); | ||
const closeSubject$ = new Subject<ChainedComponentResponse>(); | ||
const backSubject$ = new Subject<ChainedComponentResponse>(); | ||
let loader: HarnessLoader; | ||
const createComponent = createComponentFactory({ | ||
component: IxModalHeader2Component, | ||
imports: [ | ||
CommonModule, | ||
FlexLayoutModule, | ||
], | ||
declarations: [ | ||
MockComponent(CloudSyncWizardComponent), | ||
], | ||
providers: [ | ||
mockAuth(), | ||
mockProvider(IxChainedSlideInService, { | ||
components$, | ||
}), | ||
mockProvider(ChainedRef, { | ||
close: jest.fn(), | ||
getData: jest.fn(() => undefined), | ||
swap: jest.fn(), | ||
}), | ||
], | ||
}); | ||
|
||
beforeEach(() => { | ||
spectator = createComponent({ | ||
props: { | ||
title: 'Add Cloudsync Task', | ||
loading: false, | ||
}, | ||
}); | ||
loader = TestbedHarnessEnvironment.loader(spectator.fixture); | ||
}); | ||
|
||
it('shows proper title', () => { | ||
const title = spectator.query('.ix-form-title'); | ||
expect(title.textContent).toBe(' Add Cloudsync Task '); | ||
}); | ||
|
||
it('shows a working close button when only 1 component is in the queue', async () => { | ||
const closeButton = await loader.getHarness(MatButtonHarness.with({ selector: '#ix-close-icon' })); | ||
await closeButton.click(); | ||
expect(spectator.inject(ChainedRef).close).toHaveBeenCalledWith({ response: false, error: null }); | ||
const icon = spectator.query(IxIconComponent); | ||
expect(icon.name()).toBe('cancel'); | ||
}); | ||
|
||
it('shows a working back button when more than 1 component is in the queue', async () => { | ||
components$.next([{ | ||
id: 'id', | ||
component: CloudSyncWizardComponent, | ||
close$: closeSubject$, | ||
data: undefined, | ||
wide: false, | ||
}, { | ||
id: 'id2', | ||
component: CloudBackupFormComponent, | ||
close$: backSubject$, | ||
data: undefined, | ||
wide: false, | ||
}] as ChainedComponentSerialized[]); | ||
spectator.detectChanges(); | ||
const closeButton = await loader.getHarness(MatButtonHarness.with({ selector: '#ix-close-icon' })); | ||
await closeButton.click(); | ||
expect(spectator.inject(ChainedRef).close).toHaveBeenCalledWith({ response: false, error: null }); | ||
const icon = spectator.query(IxIconComponent); | ||
expect(icon.name()).toBe('mdi-chevron-left'); | ||
}); | ||
}); |
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.