diff --git a/lib/process-services-cloud/src/lib/form/components/widgets/group/group-cloud.widget.html b/lib/process-services-cloud/src/lib/form/components/widgets/group/group-cloud.widget.html index 76c2a0426a7..4514720a5dc 100644 --- a/lib/process-services-cloud/src/lib/form/components/widgets/group/group-cloud.widget.html +++ b/lib/process-services-cloud/src/lib/form/components/widgets/group/group-cloud.widget.html @@ -1,23 +1,25 @@
-
- +
+
- + + - {{ (title || 'ADF_CLOUD_GROUPS.SEARCH-GROUP') | translate }} + { beforeEach(() => { TestBed.configureTestingModule({ - imports: [CoreTestingModule, ProcessServiceCloudTestingModule, GroupCloudModule] + imports: [CoreTestingModule, GroupCloudModule] }); fixture = TestBed.createComponent(GroupCloudComponent); component = fixture.componentInstance; @@ -83,13 +82,22 @@ describe('GroupCloudComponent', () => { loader = TestbedHarnessEnvironment.loader(fixture); }); - it('should populate placeholder when title is present', () => { + it('should populate placeholder when title is present', async () => { component.title = 'TITLE_KEY'; fixture.detectChanges(); - const matLabel = element.querySelector('#adf-group-cloud-title-id'); - expect(matLabel.textContent).toEqual('TITLE_KEY'); + const inputElement = await loader.getHarness(MatInputHarness.with({ selector: '[data-automation-id="adf-cloud-group-search-input"]' })); + + expect(await inputElement.getPlaceholder()).toEqual('TITLE_KEY'); + }); + + it('should not populate placeholder when title is not present', async () => { + fixture.detectChanges(); + + const inputElement = await loader.getHarness(MatInputHarness.with({ selector: '[data-automation-id="adf-cloud-group-search-input"]' })); + + expect(await inputElement.getPlaceholder()).toEqual(''); }); describe('Search group', () => {