#1052 - fix tests to reflect tooltip changes

This commit is contained in:
Vito Albano
2016-12-06 12:30:38 +00:00
parent 4ed8caf490
commit 0fc17fbc30

View File

@@ -33,9 +33,13 @@ describe('Test ng2-activiti-analytics-report-heat-map', () => {
let debug: DebugElement; let debug: DebugElement;
let element: HTMLElement; let element: HTMLElement;
let totalCountPerc = {'sid-fake-id': 0, 'fake-start-event': 100}; let totalCountPerc = { 'sid-fake-id': 0, 'fake-start-event': 100 };
let totalTimePerc = {'sid-fake-id': 10, 'fake-start-event': 30}; let totalTimePerc = { 'sid-fake-id': 10, 'fake-start-event': 30 };
let avgTimePercentages = {'sid-fake-id': 5, 'fake-start-event': 50}; let avgTimePercentages = { 'sid-fake-id': 5, 'fake-start-event': 50 };
let totalCountValues = { 'sid-fake-id': 2, 'fake-start-event': 3 };
let totalTimeValues = { 'sid-fake-id': 1, 'fake-start-event': 4 };
let avgTimeValues = { 'sid-fake-id': 4, 'fake-start-event': 5 };
beforeEach(async(() => { beforeEach(async(() => {
TestBed.configureTestingModule({ TestBed.configureTestingModule({
@@ -65,7 +69,10 @@ describe('Test ng2-activiti-analytics-report-heat-map', () => {
component.report = { component.report = {
totalCountsPercentages: totalCountPerc, totalCountsPercentages: totalCountPerc,
totalCountValues: totalCountValues,
totalTimePercentages: totalTimePerc, totalTimePercentages: totalTimePerc,
totalTimeValues: totalTimeValues,
avgTimeValues: avgTimeValues,
avgTimePercentages: avgTimePercentages avgTimePercentages: avgTimePercentages
}; };
}); });
@@ -81,7 +88,7 @@ describe('Test ng2-activiti-analytics-report-heat-map', () => {
}); });
it('should render the dropdown with the metric options', async(() => { it('should render the dropdown with the metric options', async(() => {
component.report = {totalCountsPercentages: {'sid-fake-id': 10, 'fake-start-event': 30}}; component.report = { totalCountsPercentages: { 'sid-fake-id': 10, 'fake-start-event': 30 } };
component.onSuccess.subscribe(() => { component.onSuccess.subscribe(() => {
fixture.whenStable().then(() => { fixture.whenStable().then(() => {
@@ -106,21 +113,24 @@ describe('Test ng2-activiti-analytics-report-heat-map', () => {
})); }));
it('should change the currentmetric width totalCount', async(() => { it('should change the currentmetric width totalCount', async(() => {
let field = {value: 'totalCount'}; let field = { value: 'totalCount' };
component.onMetricChanges(field); component.onMetricChanges(field);
expect(component.currentMetric).toEqual(totalCountPerc); expect(component.currentMetric).toEqual(totalCountValues);
expect(component.currentMetricColors).toEqual(totalCountPerc);
})); }));
it('should change the currentmetric width totalTime', async(() => { it('should change the currentmetric width totalTime', async(() => {
let field = {value: 'totalTime'}; let field = { value: 'totalTime' };
component.onMetricChanges(field); component.onMetricChanges(field);
expect(component.currentMetric).toEqual(totalTimePerc); expect(component.currentMetric).toEqual(totalTimeValues);
expect(component.currentMetricColors).toEqual(totalTimePerc);
})); }));
it('should change the currentmetric width avgTime', async(() => { it('should change the currentmetric width avgTime', async(() => {
let field = {value: 'avgTime'}; let field = { value: 'avgTime' };
component.onMetricChanges(field); component.onMetricChanges(field);
expect(component.currentMetric).toEqual(avgTimePercentages); expect(component.currentMetric).toEqual(avgTimeValues);
expect(component.currentMetricColors).toEqual(avgTimePercentages);
})); }));
}); });