From f831ce4897c3f074c91836d31f7058ef6eb4b3a1 Mon Sep 17 00:00:00 2001 From: alep85 Date: Tue, 3 Dec 2024 10:07:13 +0100 Subject: [PATCH] AAE-29002 Move payload tests under describe Payload --- .../process-list-cloud.component.spec.ts | 68 ++++++++++--------- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/lib/process-services-cloud/src/lib/process/process-list/components/process-list-cloud.component.spec.ts b/lib/process-services-cloud/src/lib/process/process-list/components/process-list-cloud.component.spec.ts index ecd2f8e9bd..bc62cd580a 100644 --- a/lib/process-services-cloud/src/lib/process/process-list/components/process-list-cloud.component.spec.ts +++ b/lib/process-services-cloud/src/lib/process/process-list/components/process-list-cloud.component.spec.ts @@ -152,48 +152,50 @@ describe('ProcessListCloudComponent', () => { expect(component.rows.length).toEqual(3); }); - it('should the payload contain the appVersion if it is defined', () => { - spyOn(processListCloudService, 'getProcessByRequest').and.returnValue(of(fakeProcessCloudList)); - component.appVersion = 1; - component.ngAfterContentInit(); - component.reload(); + describe('Payload', () => { + it('should the payload contain the appVersion if it is defined', () => { + spyOn(processListCloudService, 'getProcessByRequest').and.returnValue(of(fakeProcessCloudList)); + component.appVersion = 1; + component.ngAfterContentInit(); + component.reload(); - expect(component.requestNode.appVersion).toEqual('1'); - }); + expect(component.requestNode.appVersion).toEqual('1'); + }); - it('should the payload contain all the app versions joined by a comma separator', () => { - spyOn(processListCloudService, 'getProcessByRequest').and.returnValue(of(fakeProcessCloudList)); - component.appVersion = [1, 2, 3]; - component.ngAfterContentInit(); - component.reload(); + it('should the payload contain all the app versions joined by a comma separator', () => { + spyOn(processListCloudService, 'getProcessByRequest').and.returnValue(of(fakeProcessCloudList)); + component.appVersion = [1, 2, 3]; + component.ngAfterContentInit(); + component.reload(); - expect(component.requestNode.appVersion).toEqual('1,2,3'); - }); + expect(component.requestNode.appVersion).toEqual('1,2,3'); + }); - it('should the payload NOT contain any app version when appVersion does not have a value', () => { - spyOn(processListCloudService, 'getProcessByRequest').and.returnValue(of(fakeProcessCloudList)); - component.appVersion = undefined; - component.ngAfterContentInit(); - component.reload(); + it('should the payload NOT contain any app version when appVersion does not have a value', () => { + spyOn(processListCloudService, 'getProcessByRequest').and.returnValue(of(fakeProcessCloudList)); + component.appVersion = undefined; + component.ngAfterContentInit(); + component.reload(); - expect(component.requestNode.appVersion).toEqual(''); - }); + expect(component.requestNode.appVersion).toEqual(''); + }); - it('should the payload contain the parentId if it is defined', () => { - spyOn(processListCloudService, 'getProcessByRequest').and.returnValue(of(fakeProcessCloudList)); - component.parentId = 'fake-parent-id'; - component.ngAfterContentInit(); - component.reload(); + it('should the payload contain the parentId if it is defined', () => { + spyOn(processListCloudService, 'getProcessByRequest').and.returnValue(of(fakeProcessCloudList)); + component.parentId = 'fake-parent-id'; + component.ngAfterContentInit(); + component.reload(); - expect(component.requestNode.parentId).toEqual('fake-parent-id'); - }); + expect(component.requestNode.parentId).toEqual('fake-parent-id'); + }); - it('should the payload contain an empty parentId if it is NOT defined', () => { - spyOn(processListCloudService, 'getProcessByRequest').and.returnValue(of(fakeProcessCloudList)); - component.ngAfterContentInit(); - component.reload(); + it('should the payload contain an empty parentId if it is NOT defined', () => { + spyOn(processListCloudService, 'getProcessByRequest').and.returnValue(of(fakeProcessCloudList)); + component.ngAfterContentInit(); + component.reload(); - expect(component.requestNode.parentId).toEqual(''); + expect(component.requestNode.parentId).toEqual(''); + }); }); it('should return the results if an application name is given', (done) => {