From 2421d8a851f9f86c3f5fc2d38d3fc7afab9c6893 Mon Sep 17 00:00:00 2001 From: Diogo Bastos <50139916+DiogoABastos@users.noreply.github.com> Date: Mon, 29 Apr 2024 12:33:38 +0100 Subject: [PATCH] AAE-21703 Fix group widget style (#9612) * AAE-21703 Fix group form widget style * AAE-21703 Improve tests --- .../widgets/group/group-cloud.widget.html | 34 ++++++++++--------- .../components/group-cloud.component.html | 4 +-- .../components/group-cloud.component.spec.ts | 18 +++++++--- 3 files changed, 33 insertions(+), 23 deletions(-) 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', () => {