diff --git a/packages/composer-playground/src/app/test/registry/registry.component.spec.ts b/packages/composer-playground/src/app/test/registry/registry.component.spec.ts index 16e8a65400..1387678b0c 100644 --- a/packages/composer-playground/src/app/test/registry/registry.component.spec.ts +++ b/packages/composer-playground/src/app/test/registry/registry.component.spec.ts @@ -389,6 +389,31 @@ describe(`RegistryComponent`, () => { mockAlertService.errorStatus$.next.should.have.been.calledWith('some error'); })); + + it('should handle escape', fakeAsync(() => { + mockClientService.resolveTransactionRelationship.returns(Promise.resolve({$class: 'myTransaction'})); + + let componentInstance = { + transaction: {}, + events: [] + }; + + mockNgbModal.open = sinon.stub().returns({ + componentInstance: componentInstance, + result: Promise.reject(1) + }); + + let mockTransaction = {mock: 'transaction', eventsEmitted: ['event 1']}; + component.viewTransactionData(mockTransaction); + + tick(); + + mockNgbModal.open.should.have.been.called; + componentInstance.transaction.should.deep.equal({$class: 'myTransaction'}); + componentInstance.events.should.deep.equal(['event 1']); + + mockAlertService.errorStatus$.next.should.not.have.been.called; + })); }); describe('updateTableScroll', () => { diff --git a/packages/composer-playground/src/app/test/registry/registry.component.ts b/packages/composer-playground/src/app/test/registry/registry.component.ts index 8886ff382f..b1ab2e6f7f 100644 --- a/packages/composer-playground/src/app/test/registry/registry.component.ts +++ b/packages/composer-playground/src/app/test/registry/registry.component.ts @@ -136,7 +136,9 @@ export class RegistryComponent { transactionModalRef.componentInstance.events = transaction.eventsEmitted; transactionModalRef.result.catch((error) => { - this.alertService.errorStatus$.next(error); + if (error && error !== 1) { + this.alertService.errorStatus$.next(error); + } }); }); }