import { HttpClientTestingModule } from '@angular/common/http/testing';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ReactiveFormsModule } from '@angular/forms';
+import { By } from '@angular/platform-browser';
import { RouterTestingModule } from '@angular/router/testing';
import { NgbTypeaheadModule } from '@ng-bootstrap/ng-bootstrap';
unmanaged: false,
rgw_frontend_port: 1234,
rgw_frontend_ssl_certificate: '',
- rgw_frontend_ssl_key: '',
ssl: true
});
});
ssl: false
});
});
+
+ it('should not show private key field', () => {
+ formHelper.setValue('ssl', true);
+ fixture.detectChanges();
+ const ssl_key = fixture.debugElement.query(By.css('#ssl_key'));
+ expect(ssl_key).toBeNull();
+ });
});
describe('should test service iscsi', () => {
ssl_key: [
'',
[
- CdValidators.composeIf(
- {
- service_type: 'rgw',
- unmanaged: false,
- ssl: true
- },
- [Validators.required, CdValidators.sslPrivKey()]
- ),
CdValidators.composeIf(
{
service_type: 'iscsi',
serviceSpec['ssl'] = values['ssl'];
if (values['ssl']) {
serviceSpec['rgw_frontend_ssl_certificate'] = values['ssl_cert'].trim();
- serviceSpec['rgw_frontend_ssl_key'] = values['ssl_key'].trim();
}
break;
case 'iscsi':