Skip to content
This repository was archived by the owner on Mar 8, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,7 @@ describe('ConnectionProfileDataComponent', () => {
mockConnectionProfileService.setHostname.should.be.called;
mockNgbModal.open.should.have.been.called;

patchSpy.should.have.been.calledWith({cert: 'ordererCert_2', hostnameOverride: 'orderer0'});
patchSpy.should.have.been.calledWith({cert: 'ordererCert_2', hostnameOverride: ''});
}));

it('should open peers certificate modal if hostname set', fakeAsync(() => {
Expand Down Expand Up @@ -1006,7 +1006,7 @@ describe('ConnectionProfileDataComponent', () => {
mockConnectionProfileService.setHostname.should.be.called;
mockNgbModal.open.should.have.been.called;

patchSpy.should.have.been.calledWith({cert: 'peerCert_1', hostnameOverride: 'peer0'});
patchSpy.should.have.been.calledWith({cert: 'peerCert_1', hostnameOverride: ''});
}));

it('should error on unrecognized type', fakeAsync(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -531,17 +531,11 @@ export class ConnectionProfileDataComponent {
return this.modalService.open(AddCertificateComponent).result
.then((result) => {
if (type === 'orderers') {
if (result.hostnameOverride === '') {
result.hostnameOverride = 'orderer' + index;
}
this.v1Form.controls['orderers']['controls'][index].patchValue({
cert: result.cert,
hostnameOverride: result.hostnameOverride
});
} else if (type === 'peers') {
if (result.hostnameOverride === '') {
result.hostnameOverride = 'peer' + index;
}
this.v1Form.controls['peers']['controls'][index].patchValue({
cert: result.cert,
hostnameOverride: result.hostnameOverride
Expand Down