<p class="cds--type-label-01 text-helper"
i18n>{{formGroup.get('authType').value === AUTHENTICATION.Bidirectional ? 'All fields are required.' : 'Optional fields.'}}</p>
</div>
+ @if (hostDchapKeyList.controls.length) {
@for (hostDchapKeyItem of hostDchapKeyList.controls; track $index; let i = $index) {
<div [formGroupName]="i">
<cds-text-label
</cds-text-label>
</div>
}
+ } @else {
+ <p
+ class="cds--type-label-01 text-helper"
+ i18ns>No hosts selected.</p>
+ }
</div>
</div>
</div>
});
describe('form initialization', () => {
+ beforeEach(() => {
+ fixture = TestBed.createComponent(NvmeofSubsystemsStepThreeComponent);
+ component = fixture.componentInstance;
+
+ component.stepTwoValue = {
+ hostType: 'specific',
+ addedHosts: ['nqn.2001-07.com.ceph:1776805137618']
+ } as any;
+
+ fixture.detectChanges();
+ form = component.formGroup;
+ });
+
it('should initialize form with default values', () => {
expect(form).toBeTruthy();
expect(form.get('authType')?.value).toBe(AUTHENTICATION.Unidirectional);