diff --git a/lib/core/src/lib/card-view/components/card-view-dateitem/card-view-dateitem.component.html b/lib/core/src/lib/card-view/components/card-view-dateitem/card-view-dateitem.component.html index aa09c74d5e..c9fcddfa74 100644 --- a/lib/core/src/lib/card-view/components/card-view-dateitem/card-view-dateitem.component.html +++ b/lib/core/src/lib/card-view/components/card-view-dateitem/card-view-dateitem.component.html @@ -1,29 +1,50 @@ - - {{ property.label | translate }} - -
- - {{ property.displayValue }} - - + + + {{ property.label | translate }} + + + + +
+ + - - {{ property.default | translate }} - +
+ + {{ property.default | translate }} + -
- - - {{ propertyValue }} - cancel - - - -
+ + - - - -
+ {{ propertyValue }} + cancel + + + +
+ + +
diff --git a/lib/core/src/lib/card-view/components/card-view-dateitem/card-view-dateitem.component.spec.ts b/lib/core/src/lib/card-view/components/card-view-dateitem/card-view-dateitem.component.spec.ts index 5743f89390..297678b8da 100644 --- a/lib/core/src/lib/card-view/components/card-view-dateitem/card-view-dateitem.component.spec.ts +++ b/lib/core/src/lib/card-view/components/card-view-dateitem/card-view-dateitem.component.spec.ts @@ -64,14 +64,14 @@ describe('CardViewDateItemComponent', () => { afterEach(() => fixture.destroy()); const getPropertyLabel = (): string => testingUtils.getInnerTextByCSS('.adf-property-label'); - const getPropertyValue = (): string => testingUtils.getInnerTextByCSS('.adf-property-value'); + const getPropertyInputValue = (): HTMLInputElement => testingUtils.getInputByCSS('.adf-property-value'); const getDateTime = (): string => testingUtils.getInnerTextByCSS('.adf-datepicker-span-button'); it('should render the label and value', () => { fixture.detectChanges(); expect(getPropertyLabel()).toBe('Date label'); - expect(getPropertyValue().trim()).toBe('Jul 10, 2017'); + expect(getPropertyInputValue().value.trim()).toBe('Jul 10, 2017'); }); it('should NOT render the default as value if the value is empty, editable:false and displayEmpty is false', () => { @@ -87,6 +87,7 @@ describe('CardViewDateItemComponent', () => { component.displayEmpty = false; fixture.detectChanges(); + const getPropertyValue = (): string => testingUtils.getInnerTextByCSS('.adf-property-value'); expect(getPropertyValue().trim()).toBe(''); }); @@ -103,7 +104,7 @@ describe('CardViewDateItemComponent', () => { component.displayEmpty = true; fixture.detectChanges(); - expect(getPropertyValue().trim()).toBe('FAKE-DEFAULT-KEY'); + expect(getPropertyInputValue().value.trim()).toBe('FAKE-DEFAULT-KEY'); }); it('should render the default as value if the value is empty and editable:true', () => { @@ -213,7 +214,7 @@ describe('CardViewDateItemComponent', () => { component.editable = false; fixture.detectChanges(); - testingUtils.doubleClickByDataAutomationId(`card-dateitem-${component.property.key}`); + testingUtils.doubleClickByDataAutomationId(`card-${component.property.type}-value-${component.property.key}`); fixture.detectChanges(); expect(clipboardService.copyContentToClipboard).toHaveBeenCalledWith('Jul 10, 2017', 'CORE.METADATA.ACCESSIBILITY.COPY_TO_CLIPBOARD_MESSAGE'); diff --git a/lib/core/src/lib/card-view/components/card-view-selectitem/card-view-selectitem.component.html b/lib/core/src/lib/card-view/components/card-view-selectitem/card-view-selectitem.component.html index 1a416d2731..3e13c80050 100644 --- a/lib/core/src/lib/card-view/components/card-view-selectitem/card-view-selectitem.component.html +++ b/lib/core/src/lib/card-view/components/card-view-selectitem/card-view-selectitem.component.html @@ -1,48 +1,51 @@
-
{{ property.label | translate }} -
-
-
+ - {{ property.displayValue | async | translate }} -
-
- - {{ property.label | translate }} - - - - {{ 'CORE.CARDVIEW.NONE' | translate }} - - {{ option.label | translate }} - - - -
-
+ {{ property.label | translate }} + + + + + {{ property.label | translate }} + + + + {{ 'CORE.CARDVIEW.NONE' | translate }} + + {{ option.label | translate }} + + +
{ let loader: HarnessLoader; @@ -85,7 +85,8 @@ describe('CardViewSelectItemComponent', () => { editable: false }); fixture.detectChanges(); - expect(testingUtils.getInnerTextByCSS('.adf-property-label')).toBe('Select box label'); + + expect(testingUtils.getInnerTextByDataAutomationId('card-select-label-key')).toBe('Select box label'); }); it('should render readOnly value is editable property is FALSE', () => { @@ -109,7 +110,9 @@ describe('CardViewSelectItemComponent', () => { }); fixture.detectChanges(); - expect(getReadOnlyElement().nativeElement.title).toBe('Two'); + + const inputEl = getReadOnlyElement().nativeElement as HTMLInputElement; + expect(inputEl.value).toBe('Two'); }); it('should be possible edit selectBox item', async () => { @@ -284,7 +287,9 @@ describe('CardViewSelectItemComponent', () => { const autocompleteValueSpy = spyOn(cardViewUpdateService.autocompleteInputValue$, 'next'); component.editedValue = ''; component.editable = true; - component.ngOnChanges({ property: { firstChange: true } } as any); + component.ngOnChanges({ + property: new SimpleChange(undefined, component.property, true) + }); fixture.detectChanges(); component.autocompleteControl.setValue('new value'); diff --git a/lib/core/src/lib/card-view/components/card-view/card-view.component.spec.ts b/lib/core/src/lib/card-view/components/card-view/card-view.component.spec.ts index 2655e74a16..ab48954151 100644 --- a/lib/core/src/lib/card-view/components/card-view/card-view.component.spec.ts +++ b/lib/core/src/lib/card-view/components/card-view/card-view.component.spec.ts @@ -53,7 +53,7 @@ describe('CardViewComponent', () => { const getPropertyLabel = (): string => testingUtils.getInnerTextByCSS('.adf-property-label'); const getPropertyValue = (): string => testingUtils.getByCSS('.adf-property-value').nativeElement.value; - const getPropertyValueText = (): string => testingUtils.getInnerTextByCSS('.adf-property-value'); + const getPropertyValueText = (): string => testingUtils.getInputByCSS('.adf-property-value').value; const getPropertyValueByDataAutomationId = (dataAutomationId: string): string => testingUtils.getByDataAutomationId(dataAutomationId).nativeElement.value; diff --git a/lib/process-services-cloud/src/lib/process/process-header/components/process-header-cloud.component.spec.ts b/lib/process-services-cloud/src/lib/process/process-header/components/process-header-cloud.component.spec.ts index c1e02b7b5e..41bdcfc4d1 100644 --- a/lib/process-services-cloud/src/lib/process/process-header/components/process-header-cloud.component.spec.ts +++ b/lib/process-services-cloud/src/lib/process/process-header/components/process-header-cloud.component.spec.ts @@ -111,7 +111,7 @@ describe('ProcessHeaderCloudComponent', () => { await fixture.whenStable(); const valueEl = fixture.debugElement.query(By.css('[data-automation-id="header-startDate"] .adf-property-value')); - expect(valueEl.nativeElement.innerText.trim()).toBe('Mar 9, 2019'); + expect(valueEl.nativeElement.value.trim()).toBe('Mar 9, 2019'); }); it('should display lastModified date', async () => { @@ -121,7 +121,7 @@ describe('ProcessHeaderCloudComponent', () => { await fixture.whenStable(); const valueEl = fixture.debugElement.query(By.css('[data-automation-id="header-lastModified"] .adf-property-value')); - expect(valueEl.nativeElement.innerText.trim()).toBe('Mar 9, 2019'); + expect(valueEl.nativeElement.value.trim()).toBe('Mar 9, 2019'); }); it('should display parentId', async () => { @@ -216,8 +216,8 @@ describe('ProcessHeaderCloudComponent', () => { const lastModifiedElement = fixture.debugElement.query(By.css('[data-automation-id="header-lastModified"] .adf-property-value')); expect(component.dateFormat).toEqual('full'); - expect(startedDateElement.nativeElement.innerText.trim()).toBe('Saturday, March 9, 2019 at 12:00:00 AM GMT+00:00'); - expect(lastModifiedElement.nativeElement.innerText.trim()).toBe('Saturday, March 9, 2019 at 12:00:00 AM GMT+00:00'); + expect(startedDateElement.nativeElement.value.trim()).toBe('Saturday, March 9, 2019 at 12:00:00 AM GMT+00:00'); + expect(lastModifiedElement.nativeElement.value.trim()).toBe('Saturday, March 9, 2019 at 12:00:00 AM GMT+00:00'); }); }); }); diff --git a/lib/process-services-cloud/src/lib/task/task-header/components/task-header-cloud.component.spec.ts b/lib/process-services-cloud/src/lib/task/task-header/components/task-header-cloud.component.spec.ts index e44a64fb68..77b7043b3e 100644 --- a/lib/process-services-cloud/src/lib/task/task-header/components/task-header-cloud.component.spec.ts +++ b/lib/process-services-cloud/src/lib/task/task-header/components/task-header-cloud.component.spec.ts @@ -506,7 +506,7 @@ describe('TaskHeaderCloudComponent', () => { const createdDateElement = fixture.debugElement.query(By.css('[data-automation-id="header-created"] .adf-property-value')); expect(component.dateFormat).toEqual('full'); - expect(createdDateElement.nativeElement.innerText.trim()).toBe('Monday, December 17, 2018 at 12:00:00 AM GMT+00:00'); + expect(createdDateElement.nativeElement.value.trim()).toBe('Monday, December 17, 2018 at 12:00:00 AM GMT+00:00'); }); }); diff --git a/lib/process-services/src/lib/attachment/task-attachment-list/task-attachment-list.component.spec.ts b/lib/process-services/src/lib/attachment/task-attachment-list/task-attachment-list.component.spec.ts index dc0aaf3dab..3483c63ed6 100644 --- a/lib/process-services/src/lib/attachment/task-attachment-list/task-attachment-list.component.spec.ts +++ b/lib/process-services/src/lib/attachment/task-attachment-list/task-attachment-list.component.spec.ts @@ -207,9 +207,7 @@ describe('TaskAttachmentList', () => { fixture.whenStable().then(() => { fixture.detectChanges(); - expect(fixture.nativeElement.querySelector('div[adf-empty-list-header]').innerText.trim()).toEqual( - 'ADF_TASK_LIST.ATTACHMENT.EMPTY.HEADER' - ); + expect(fixture.nativeElement.querySelector('div[adf-empty-list-header]').value.trim()).toEqual('ADF_TASK_LIST.ATTACHMENT.EMPTY.HEADER'); }); }); diff --git a/lib/process-services/src/lib/process-list/components/process-instance-header/process-instance-header.component.spec.ts b/lib/process-services/src/lib/process-list/components/process-instance-header/process-instance-header.component.spec.ts index ac64775349..1ae7eddace 100644 --- a/lib/process-services/src/lib/process-list/components/process-instance-header/process-instance-header.component.spec.ts +++ b/lib/process-services/src/lib/process-list/components/process-instance-header/process-instance-header.component.spec.ts @@ -64,7 +64,7 @@ describe('ProcessInstanceHeaderComponent', () => { component.ngOnChanges(); fixture.detectChanges(); const valueEl = fixture.nativeElement.querySelector('[data-automation-id="card-dateitem-ended"]'); - expect(valueEl.innerText).toBe('Nov 3, 2016'); + expect(valueEl.value).toBe('Nov 3, 2016'); }); it('should display placeholder if no due date', () => { @@ -72,7 +72,7 @@ describe('ProcessInstanceHeaderComponent', () => { component.ngOnChanges(); fixture.detectChanges(); const valueEl = fixture.nativeElement.querySelector('[data-automation-id="card-dateitem-ended"]'); - expect(valueEl.innerText).toBe('ADF_PROCESS_LIST.PROPERTIES.END_DATE_DEFAULT'); + expect(valueEl.value).toBe('ADF_PROCESS_LIST.PROPERTIES.END_DATE_DEFAULT'); }); it('should display process category', async () => { @@ -98,7 +98,7 @@ describe('ProcessInstanceHeaderComponent', () => { component.ngOnChanges(); fixture.detectChanges(); const valueEl = fixture.nativeElement.querySelector('[data-automation-id="card-dateitem-created"]'); - expect(valueEl.innerText).toBe('Nov 3, 2016'); + expect(valueEl.value).toBe('Nov 3, 2016'); }); it('should display started by', async () => {