From 6e1d7336ac6e73cb751b2df37934e4afe14ec468 Mon Sep 17 00:00:00 2001 From: Mario Romano Date: Sat, 11 Aug 2018 01:27:54 +0100 Subject: [PATCH] [3463] add missing informations to report diagram (#3690) --- .../tooltip/diagram-tooltip.component.html | 4 +++ .../tooltip/diagram-tooltip.component.spec.ts | 25 +++++++++++++++---- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/lib/insights/diagram/components/tooltip/diagram-tooltip.component.html b/lib/insights/diagram/components/tooltip/diagram-tooltip.component.html index 39f606a33b..3e91ad3f70 100644 --- a/lib/insights/diagram/components/tooltip/diagram-tooltip.component.html +++ b/lib/insights/diagram/components/tooltip/diagram-tooltip.component.html @@ -1,6 +1,10 @@
{{ data.type }} {{ data.name || data.id }}
+
+ {{ data.value }} + {{ data.dataType }} +
Name: {{ data.name }} diff --git a/lib/insights/diagram/components/tooltip/diagram-tooltip.component.spec.ts b/lib/insights/diagram/components/tooltip/diagram-tooltip.component.spec.ts index 55e9e1ac0c..0fdbaf7c70 100644 --- a/lib/insights/diagram/components/tooltip/diagram-tooltip.component.spec.ts +++ b/lib/insights/diagram/components/tooltip/diagram-tooltip.component.spec.ts @@ -41,7 +41,7 @@ describe('DiagramTooltipComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ DiagramTooltipComponent ] + declarations: [DiagramTooltipComponent] }).compileComponents(); })); @@ -91,8 +91,8 @@ describe('DiagramTooltipComponent', () => { it('should render the properties, if there is any', () => { data.properties = [ - { name: 'property-1-name', value: 'property-1-value' }, - { name: 'property-2-name', value: 'property-2-value' } + {name: 'property-1-name', value: 'property-1-value'}, + {name: 'property-2-name', value: 'property-2-value'} ]; fixture.detectChanges(); @@ -106,6 +106,21 @@ describe('DiagramTooltipComponent', () => { expect(propertyValues[0].nativeElement.innerText).toBe('property-1-value'); expect(propertyValues[1].nativeElement.innerText).toBe('property-2-value'); }); + + it('should render value and data type', () => { + data.value = '1'; + data.dataType = 'hour'; + + fixture.detectChanges(); + + let propertyValue = fixture.debugElement.queryAll(By.css('.adf-diagram-heat-value > .adf-diagram-value')), + propertyValueType = fixture.debugElement.queryAll(By.css('.adf-diagram-heat-value > .adf-diagram-valuetype')); + + expect(propertyValue.length).toBe(1); + expect(propertyValueType.length).toBe(1); + expect(propertyValue[0].nativeElement.innerText).toBe('1'); + expect(propertyValueType[0].nativeElement.innerText).toBe(' hour'); + }); }); describe('Tooltip functionality', () => { @@ -114,12 +129,12 @@ describe('DiagramTooltipComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ DiagramTooltipComponent, TestHostComponent ] + declarations: [DiagramTooltipComponent, TestHostComponent] }).compileComponents(); })); beforeEach(() => { - fixture = TestBed.createComponent(TestHostComponent); + fixture = TestBed.createComponent(TestHostComponent); fixture.detectChanges(); });