mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
[ACS-11153] remove the usage of ng reflect from the unit tests (#11666)
* [ACS-11153] Removed usages of ng reflect from card view dateitem and diagram activities * [ACS-11153] Removed usages of ng-reflect * [ACS-11153] Added eslint rule
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -20,13 +20,15 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import * as boundaryEventMock from '../../mock/diagram/diagram-boundary.mock';
|
||||
import { DiagramComponent } from './diagram.component';
|
||||
import { InsightsTestingModule } from '../../testing/insights.testing.module';
|
||||
import { UnitTestingUtils } from '@alfresco/adf-core';
|
||||
import { RaphaelCircleDirective } from '@alfresco/adf-insights';
|
||||
|
||||
declare let jasmine: any;
|
||||
|
||||
describe('Diagrams boundary', () => {
|
||||
let component: any;
|
||||
let fixture: ComponentFixture<DiagramComponent>;
|
||||
let element: HTMLElement;
|
||||
let unitTestingUtils: UnitTestingUtils;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
@@ -34,8 +36,8 @@ describe('Diagrams boundary', () => {
|
||||
});
|
||||
fixture = TestBed.createComponent(DiagramComponent);
|
||||
component = fixture.componentInstance;
|
||||
element = fixture.nativeElement;
|
||||
fixture.detectChanges();
|
||||
unitTestingUtils = new UnitTestingUtils(fixture.debugElement);
|
||||
|
||||
jasmine.Ajax.install();
|
||||
component.processInstanceId = '38399';
|
||||
@@ -62,24 +64,24 @@ describe('Diagrams boundary', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector('diagram-boundary-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-boundary-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-boundary-event > diagram-container-icon-event >' + ' div > div > diagram-icon-timer'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -94,27 +96,27 @@ describe('Diagrams boundary', () => {
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
|
||||
const coloredShape: any = element.querySelector('diagram-boundary-event>raphael-circle[ng-reflect-stroke="#017501"]');
|
||||
expect(coloredShape).not.toBeNull();
|
||||
const coloredShape = unitTestingUtils.getByCSS('diagram-boundary-event>raphael-circle');
|
||||
expect(coloredShape.injector.get(RaphaelCircleDirective).stroke).toBe('#017501');
|
||||
|
||||
const shape: any = element.querySelector('diagram-boundary-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-boundary-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-boundary-event > diagram-container-icon-event >' + ' div > div > diagram-icon-timer'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -129,27 +131,27 @@ describe('Diagrams boundary', () => {
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
|
||||
const coloredShape: any = element.querySelector('diagram-boundary-event>raphael-circle[ng-reflect-stroke="#2632aa"]');
|
||||
expect(coloredShape).not.toBeNull();
|
||||
const coloredShape = unitTestingUtils.getByCSS('diagram-boundary-event>raphael-circle');
|
||||
expect(coloredShape.injector.get(RaphaelCircleDirective).stroke).toBe('#2632aa');
|
||||
|
||||
const shape: any = element.querySelector('diagram-boundary-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-boundary-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-boundary-event > diagram-container-icon-event >' + ' div > div > diagram-icon-timer'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -163,24 +165,24 @@ describe('Diagrams boundary', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector('diagram-boundary-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-boundary-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-boundary-event > diagram-container-icon-event >' + ' div > div > diagram-icon-error'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -195,27 +197,27 @@ describe('Diagrams boundary', () => {
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
|
||||
const coloredShape: any = element.querySelector('diagram-boundary-event>raphael-circle[ng-reflect-stroke="#017501"]');
|
||||
expect(coloredShape).not.toBeNull();
|
||||
const coloredShape = unitTestingUtils.getByCSS('diagram-boundary-event>raphael-circle');
|
||||
expect(coloredShape.injector.get(RaphaelCircleDirective).stroke).toBe('#017501');
|
||||
|
||||
const shape: any = element.querySelector('diagram-boundary-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-boundary-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-boundary-event > diagram-container-icon-event >' + ' div > div > diagram-icon-error'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -230,27 +232,27 @@ describe('Diagrams boundary', () => {
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
|
||||
const coloredShape: any = element.querySelector('diagram-boundary-event>raphael-circle[ng-reflect-stroke="#2632aa"]');
|
||||
expect(coloredShape).not.toBeNull();
|
||||
const coloredShape = unitTestingUtils.getByCSS('diagram-boundary-event>raphael-circle');
|
||||
expect(coloredShape.injector.get(RaphaelCircleDirective).stroke).toBe('#2632aa');
|
||||
|
||||
const shape: any = element.querySelector('diagram-boundary-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-boundary-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-boundary-event > diagram-container-icon-event >' + ' div > div > diagram-icon-error'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -264,24 +266,24 @@ describe('Diagrams boundary', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector('diagram-boundary-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-boundary-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-boundary-event > diagram-container-icon-event >' + ' div > div > diagram-icon-signal'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -296,27 +298,27 @@ describe('Diagrams boundary', () => {
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
|
||||
const coloredShape: any = element.querySelector('diagram-boundary-event>raphael-circle[ng-reflect-stroke="#017501"]');
|
||||
expect(coloredShape).not.toBeNull();
|
||||
const coloredShape = unitTestingUtils.getByCSS('diagram-boundary-event>raphael-circle');
|
||||
expect(coloredShape.injector.get(RaphaelCircleDirective).stroke).toBe('#017501');
|
||||
|
||||
const shape: any = element.querySelector('diagram-boundary-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-boundary-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-boundary-event > diagram-container-icon-event >' + ' div > div > diagram-icon-signal'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -331,27 +333,27 @@ describe('Diagrams boundary', () => {
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
|
||||
const coloredShape: any = element.querySelector('diagram-boundary-event>raphael-circle[ng-reflect-stroke="#2632aa"]');
|
||||
expect(coloredShape).not.toBeNull();
|
||||
const coloredShape = unitTestingUtils.getByCSS('diagram-boundary-event>raphael-circle');
|
||||
expect(coloredShape.injector.get(RaphaelCircleDirective).stroke).toBe('#2632aa');
|
||||
|
||||
const shape: any = element.querySelector('diagram-boundary-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-boundary-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-boundary-event > diagram-container-icon-event >' + ' div > div > diagram-icon-signal'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -365,24 +367,24 @@ describe('Diagrams boundary', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector('diagram-boundary-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-boundary-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-boundary-event > diagram-container-icon-event >' + ' div > div > diagram-icon-message'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -397,27 +399,27 @@ describe('Diagrams boundary', () => {
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
|
||||
const coloredShape: any = element.querySelector('diagram-boundary-event>raphael-circle[ng-reflect-stroke="#017501"]');
|
||||
expect(coloredShape).not.toBeNull();
|
||||
const coloredShape = unitTestingUtils.getByCSS('diagram-boundary-event>raphael-circle');
|
||||
expect(coloredShape.injector.get(RaphaelCircleDirective).stroke).toBe('#017501');
|
||||
|
||||
const shape: any = element.querySelector('diagram-boundary-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-boundary-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-boundary-event > diagram-container-icon-event >' + ' div > div > diagram-icon-message'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -432,27 +434,27 @@ describe('Diagrams boundary', () => {
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
|
||||
const coloredShape: any = element.querySelector('diagram-boundary-event>raphael-circle[ng-reflect-stroke="#2632aa"]');
|
||||
expect(coloredShape).not.toBeNull();
|
||||
const coloredShape = unitTestingUtils.getByCSS('diagram-boundary-event>raphael-circle');
|
||||
expect(coloredShape.injector.get(RaphaelCircleDirective).stroke).toBe('#2632aa');
|
||||
|
||||
const shape: any = element.querySelector('diagram-boundary-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-boundary-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-boundary-event > diagram-container-icon-event >' + ' div > div > diagram-icon-message'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -466,24 +468,24 @@ describe('Diagrams boundary', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector('diagram-boundary-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-boundary-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-boundary-event > diagram-container-icon-event >' + ' div > div > diagram-icon-message'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -498,27 +500,27 @@ describe('Diagrams boundary', () => {
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
|
||||
const coloredShape: any = element.querySelector('diagram-boundary-event>raphael-circle[ng-reflect-stroke="#017501"]');
|
||||
expect(coloredShape).not.toBeNull();
|
||||
const coloredShape = unitTestingUtils.getByCSS('diagram-boundary-event>raphael-circle');
|
||||
expect(coloredShape.injector.get(RaphaelCircleDirective).stroke).toBe('#017501');
|
||||
|
||||
const shape: any = element.querySelector('diagram-boundary-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-boundary-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-boundary-event > diagram-container-icon-event >' + ' div > div > diagram-icon-message'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -533,27 +535,27 @@ describe('Diagrams boundary', () => {
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
|
||||
const coloredShape: any = element.querySelector('diagram-boundary-event>raphael-circle[ng-reflect-stroke="#2632aa"]');
|
||||
expect(coloredShape).not.toBeNull();
|
||||
const coloredShape = unitTestingUtils.getByCSS('diagram-boundary-event>raphael-circle');
|
||||
expect(coloredShape.injector.get(RaphaelCircleDirective).stroke).toBe('#2632aa');
|
||||
|
||||
const shape: any = element.querySelector('diagram-boundary-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-boundary-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-boundary-event > diagram-container-icon-event >' + ' div > div > diagram-icon-message'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -569,24 +571,24 @@ describe('Diagrams boundary', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector('diagram-boundary-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-boundary-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-boundary-event > diagram-container-icon-event >' + ' div > div > diagram-icon-timer'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -600,24 +602,24 @@ describe('Diagrams boundary', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector('diagram-boundary-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-boundary-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-boundary-event > diagram-container-icon-event >' + ' div > div > diagram-icon-error'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -631,24 +633,24 @@ describe('Diagrams boundary', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector('diagram-boundary-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-boundary-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-boundary-event > diagram-container-icon-event >' + ' div > div > diagram-icon-signal'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -662,24 +664,24 @@ describe('Diagrams boundary', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector('diagram-boundary-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-boundary-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-boundary-event > diagram-container-icon-event >' + ' div > div > diagram-icon-message'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -693,24 +695,24 @@ describe('Diagrams boundary', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector('diagram-boundary-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-boundary-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-boundary-event > diagram-container-icon-event >' + ' div > div > diagram-icon-message'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
+132
-146
@@ -20,13 +20,15 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import * as intermediateCatchingMock from '../../mock/diagram/diagram-intermediate.mock';
|
||||
import { DiagramComponent } from './diagram.component';
|
||||
import { InsightsTestingModule } from '../../testing/insights.testing.module';
|
||||
import { UnitTestingUtils } from '@alfresco/adf-core';
|
||||
import { RaphaelCircleDirective } from '@alfresco/adf-insights';
|
||||
|
||||
declare let jasmine: any;
|
||||
|
||||
describe('Diagrams Catching', () => {
|
||||
let component: any;
|
||||
let fixture: ComponentFixture<DiagramComponent>;
|
||||
let element: HTMLElement;
|
||||
let unitTestingUtils: UnitTestingUtils;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
@@ -34,8 +36,8 @@ describe('Diagrams Catching', () => {
|
||||
});
|
||||
fixture = TestBed.createComponent(DiagramComponent);
|
||||
component = fixture.componentInstance;
|
||||
element = fixture.nativeElement;
|
||||
fixture.detectChanges();
|
||||
unitTestingUtils = new UnitTestingUtils(fixture.debugElement);
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
@@ -65,24 +67,24 @@ describe('Diagrams Catching', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector('diagram-intermediate-catching-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-intermediate-catching-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-intermediate-catching-event > diagram-container-icon-event >' + ' div > div > diagram-icon-timer'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -96,24 +98,24 @@ describe('Diagrams Catching', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector('diagram-intermediate-catching-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-intermediate-catching-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-intermediate-catching-event > diagram-container-icon-event >' + ' div > div > diagram-icon-error'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -127,24 +129,24 @@ describe('Diagrams Catching', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector('diagram-intermediate-catching-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-intermediate-catching-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-intermediate-catching-event > diagram-container-icon-event >' + ' div > div > diagram-icon-signal'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -158,24 +160,24 @@ describe('Diagrams Catching', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector('diagram-intermediate-catching-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-intermediate-catching-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-intermediate-catching-event > diagram-container-icon-event >' + ' div > div > diagram-icon-message'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -191,24 +193,24 @@ describe('Diagrams Catching', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector('diagram-intermediate-catching-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-intermediate-catching-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-intermediate-catching-event > diagram-container-icon-event >' + ' div > div > diagram-icon-timer'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -223,29 +225,27 @@ describe('Diagrams Catching', () => {
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
|
||||
const coloredShape: any = element.querySelector(
|
||||
'diagram-intermediate-catching-event>raphael-circle[ng-reflect-stroke="#017501"]'
|
||||
);
|
||||
expect(coloredShape).not.toBeNull();
|
||||
const coloredShape = unitTestingUtils.getByCSS('diagram-intermediate-catching-event>raphael-circle');
|
||||
expect(coloredShape.injector.get(RaphaelCircleDirective).stroke).toBe('#017501');
|
||||
|
||||
const shape: any = element.querySelector('diagram-intermediate-catching-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-intermediate-catching-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-intermediate-catching-event > diagram-container-icon-event >' + ' div > div > diagram-icon-timer'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -260,29 +260,27 @@ describe('Diagrams Catching', () => {
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
|
||||
const coloredShape: any = element.querySelector(
|
||||
'diagram-intermediate-catching-event>raphael-circle[ng-reflect-stroke="#2632aa"]'
|
||||
);
|
||||
expect(coloredShape).not.toBeNull();
|
||||
const coloredShape = unitTestingUtils.getByCSS('diagram-intermediate-catching-event>raphael-circle');
|
||||
expect(coloredShape.injector.get(RaphaelCircleDirective).stroke).toBe('#2632aa');
|
||||
|
||||
const shape: any = element.querySelector('diagram-intermediate-catching-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-intermediate-catching-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-intermediate-catching-event > diagram-container-icon-event >' + ' div > div > diagram-icon-timer'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -296,24 +294,24 @@ describe('Diagrams Catching', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector('diagram-intermediate-catching-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-intermediate-catching-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-intermediate-catching-event > diagram-container-icon-event >' + ' div > div > diagram-icon-error'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -328,29 +326,27 @@ describe('Diagrams Catching', () => {
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
|
||||
const coloredShape: any = element.querySelector(
|
||||
'diagram-intermediate-catching-event>raphael-circle[ng-reflect-stroke="#017501"]'
|
||||
);
|
||||
expect(coloredShape).not.toBeNull();
|
||||
const coloredShape = unitTestingUtils.getByCSS('diagram-intermediate-catching-event>raphael-circle');
|
||||
expect(coloredShape.injector.get(RaphaelCircleDirective).stroke).toBe('#017501');
|
||||
|
||||
const shape: any = element.querySelector('diagram-intermediate-catching-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-intermediate-catching-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-intermediate-catching-event > diagram-container-icon-event >' + ' div > div > diagram-icon-error'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -365,29 +361,27 @@ describe('Diagrams Catching', () => {
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
|
||||
const coloredShape: any = element.querySelector(
|
||||
'diagram-intermediate-catching-event>raphael-circle[ng-reflect-stroke="#2632aa"]'
|
||||
);
|
||||
expect(coloredShape).not.toBeNull();
|
||||
const coloredShape = unitTestingUtils.getByCSS('diagram-intermediate-catching-event>raphael-circle');
|
||||
expect(coloredShape.injector.get(RaphaelCircleDirective).stroke).toBe('#2632aa');
|
||||
|
||||
const shape: any = element.querySelector('diagram-intermediate-catching-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-intermediate-catching-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-intermediate-catching-event > diagram-container-icon-event >' + ' div > div > diagram-icon-error'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -401,24 +395,24 @@ describe('Diagrams Catching', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector('diagram-intermediate-catching-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-intermediate-catching-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-intermediate-catching-event > diagram-container-icon-event >' + ' div > div > diagram-icon-signal'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -433,29 +427,27 @@ describe('Diagrams Catching', () => {
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
|
||||
const coloredShape: any = element.querySelector(
|
||||
'diagram-intermediate-catching-event>raphael-circle[ng-reflect-stroke="#017501"]'
|
||||
);
|
||||
expect(coloredShape).not.toBeNull();
|
||||
const coloredShape = unitTestingUtils.getByCSS('diagram-intermediate-catching-event>raphael-circle');
|
||||
expect(coloredShape.injector.get(RaphaelCircleDirective).stroke).toBe('#017501');
|
||||
|
||||
const shape: any = element.querySelector('diagram-intermediate-catching-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-intermediate-catching-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-intermediate-catching-event > diagram-container-icon-event >' + ' div > div > diagram-icon-signal'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -470,29 +462,27 @@ describe('Diagrams Catching', () => {
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
|
||||
const coloredShape: any = element.querySelector(
|
||||
'diagram-intermediate-catching-event>raphael-circle[ng-reflect-stroke="#2632aa"]'
|
||||
);
|
||||
expect(coloredShape).not.toBeNull();
|
||||
const coloredShape = unitTestingUtils.getByCSS('diagram-intermediate-catching-event>raphael-circle');
|
||||
expect(coloredShape.injector.get(RaphaelCircleDirective).stroke).toBe('#2632aa');
|
||||
|
||||
const shape: any = element.querySelector('diagram-intermediate-catching-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-intermediate-catching-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-intermediate-catching-event > diagram-container-icon-event >' + ' div > div > diagram-icon-signal'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -506,24 +496,24 @@ describe('Diagrams Catching', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector('diagram-intermediate-catching-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-intermediate-catching-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-intermediate-catching-event > diagram-container-icon-event >' + ' div > div > diagram-icon-message'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -538,29 +528,27 @@ describe('Diagrams Catching', () => {
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
|
||||
const coloredShape: any = element.querySelector(
|
||||
'diagram-intermediate-catching-event>raphael-circle[ng-reflect-stroke="#017501"]'
|
||||
);
|
||||
expect(coloredShape).not.toBeNull();
|
||||
const coloredShape = unitTestingUtils.getByCSS('diagram-intermediate-catching-event>raphael-circle');
|
||||
expect(coloredShape.injector.get(RaphaelCircleDirective).stroke).toBe('#017501');
|
||||
|
||||
const shape: any = element.querySelector('diagram-intermediate-catching-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-intermediate-catching-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-intermediate-catching-event > diagram-container-icon-event >' + ' div > div > diagram-icon-message'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -575,29 +563,27 @@ describe('Diagrams Catching', () => {
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
|
||||
const coloredShape: any = element.querySelector(
|
||||
'diagram-intermediate-catching-event>raphael-circle[ng-reflect-stroke="#2632aa"]'
|
||||
);
|
||||
expect(coloredShape).not.toBeNull();
|
||||
const coloredShape = unitTestingUtils.getByCSS('diagram-intermediate-catching-event>raphael-circle');
|
||||
expect(coloredShape.injector.get(RaphaelCircleDirective).stroke).toBe('#2632aa');
|
||||
|
||||
const shape: any = element.querySelector('diagram-intermediate-catching-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-intermediate-catching-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-intermediate-catching-event > diagram-container-icon-event >' + ' div > div > diagram-icon-message'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -20,13 +20,15 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import * as diagramsEventsMock from '../../mock/diagram/diagram-events.mock';
|
||||
import { DiagramComponent } from './diagram.component';
|
||||
import { InsightsTestingModule } from '../../testing/insights.testing.module';
|
||||
import { UnitTestingUtils } from '@alfresco/adf-core';
|
||||
import { RaphaelCircleDirective } from '@alfresco/adf-insights';
|
||||
|
||||
declare let jasmine: any;
|
||||
|
||||
describe('Diagrams events', () => {
|
||||
let component: any;
|
||||
let fixture: ComponentFixture<DiagramComponent>;
|
||||
let element: HTMLElement;
|
||||
let unitTestingUtils: UnitTestingUtils;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
@@ -34,8 +36,8 @@ describe('Diagrams events', () => {
|
||||
});
|
||||
fixture = TestBed.createComponent(DiagramComponent);
|
||||
component = fixture.componentInstance;
|
||||
element = fixture.nativeElement;
|
||||
fixture.detectChanges();
|
||||
unitTestingUtils = new UnitTestingUtils(fixture.debugElement);
|
||||
|
||||
jasmine.Ajax.install();
|
||||
component.processInstanceId = '38399';
|
||||
@@ -63,11 +65,11 @@ describe('Diagrams events', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle');
|
||||
const event = unitTestingUtils.getByCSS('diagram-start-event > diagram-event > raphael-circle');
|
||||
expect(event).not.toBeNull();
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -81,17 +83,17 @@ describe('Diagrams events', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).toBeDefined();
|
||||
const event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle');
|
||||
const event = unitTestingUtils.getByCSS('diagram-start-event > diagram-event > raphael-circle');
|
||||
expect(event).not.toBeNull();
|
||||
|
||||
const iconEvent: any = element.querySelector(
|
||||
const iconEvent = unitTestingUtils.getByCSS(
|
||||
'diagram-start-event > diagram-event >' +
|
||||
' diagram-container-icon-event > div > div > diagram-icon-timer > raphael-icon-timer'
|
||||
);
|
||||
expect(iconEvent).not.toBeNull();
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -106,17 +108,17 @@ describe('Diagrams events', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).toBeDefined();
|
||||
const event: any = element.querySelector('diagram-start-event');
|
||||
const event = unitTestingUtils.getByCSS('diagram-start-event');
|
||||
expect(event).not.toBeNull();
|
||||
|
||||
const iconEvent: any = element.querySelector(
|
||||
const iconEvent = unitTestingUtils.getByCSS(
|
||||
'diagram-start-event > diagram-event >' +
|
||||
' diagram-container-icon-event > div > div > diagram-icon-signal > raphael-icon-signal'
|
||||
);
|
||||
expect(iconEvent).not.toBeNull();
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -130,17 +132,17 @@ describe('Diagrams events', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).toBeDefined();
|
||||
const event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle');
|
||||
const event = unitTestingUtils.getByCSS('diagram-start-event > diagram-event > raphael-circle');
|
||||
expect(event).not.toBeNull();
|
||||
|
||||
const iconEvent: any = element.querySelector(
|
||||
const iconEvent = unitTestingUtils.getByCSS(
|
||||
'diagram-start-event > diagram-event >' +
|
||||
' diagram-container-icon-event > div > div > diagram-icon-message > raphael-icon-message'
|
||||
);
|
||||
expect(iconEvent).not.toBeNull();
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -154,17 +156,17 @@ describe('Diagrams events', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).toBeDefined();
|
||||
const event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle');
|
||||
const event = unitTestingUtils.getByCSS('diagram-start-event > diagram-event > raphael-circle');
|
||||
expect(event).not.toBeNull();
|
||||
|
||||
const iconEvent: any = element.querySelector(
|
||||
const iconEvent = unitTestingUtils.getByCSS(
|
||||
'diagram-start-event > diagram-event >' +
|
||||
' diagram-container-icon-event > div > div > diagram-icon-error > raphael-icon-error'
|
||||
);
|
||||
expect(iconEvent).not.toBeNull();
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -178,11 +180,11 @@ describe('Diagrams events', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).toBeDefined();
|
||||
const event: any = element.querySelector('diagram-end-event > diagram-event > raphael-circle');
|
||||
const event = unitTestingUtils.getByCSS('diagram-end-event > diagram-event > raphael-circle');
|
||||
expect(event).not.toBeNull();
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -196,16 +198,16 @@ describe('Diagrams events', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).toBeDefined();
|
||||
const event: any = element.querySelector('diagram-end-event > diagram-event > raphael-circle');
|
||||
const event = unitTestingUtils.getByCSS('diagram-end-event > diagram-event > raphael-circle');
|
||||
expect(event).not.toBeNull();
|
||||
|
||||
const iconEvent: any = element.querySelector(
|
||||
const iconEvent = unitTestingUtils.getByCSS(
|
||||
'diagram-end-event > diagram-event >' + ' diagram-container-icon-event > div > div > diagram-icon-error > raphael-icon-error'
|
||||
);
|
||||
expect(iconEvent).not.toBeNull();
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -221,11 +223,11 @@ describe('Diagrams events', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle');
|
||||
const event = unitTestingUtils.getByCSS('diagram-start-event > diagram-event > raphael-circle');
|
||||
expect(event).not.toBeNull();
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -239,11 +241,11 @@ describe('Diagrams events', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle[ng-reflect-stroke="#017501"]');
|
||||
expect(event).not.toBeNull();
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const event = unitTestingUtils.getByCSS('diagram-start-event > diagram-event > raphael-circle');
|
||||
expect(event?.injector.get(RaphaelCircleDirective).stroke).toBe('#017501');
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -257,11 +259,11 @@ describe('Diagrams events', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle[ng-reflect-stroke="#2632aa"]');
|
||||
expect(event).not.toBeNull();
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const event = unitTestingUtils.getByCSS('diagram-start-event > diagram-event > raphael-circle');
|
||||
expect(event?.injector.get(RaphaelCircleDirective).stroke).toBe('#2632aa');
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -275,17 +277,17 @@ describe('Diagrams events', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).toBeDefined();
|
||||
const event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle');
|
||||
const event = unitTestingUtils.getByCSS('diagram-start-event > diagram-event > raphael-circle');
|
||||
expect(event).not.toBeNull();
|
||||
|
||||
const iconEvent: any = element.querySelector(
|
||||
const iconEvent = unitTestingUtils.getByCSS(
|
||||
'diagram-start-event > diagram-event >' +
|
||||
' diagram-container-icon-event > div > div > diagram-icon-timer > raphael-icon-timer'
|
||||
);
|
||||
expect(iconEvent).not.toBeNull();
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -300,17 +302,17 @@ describe('Diagrams events', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).toBeDefined();
|
||||
const event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle[ng-reflect-stroke="#017501"]');
|
||||
expect(event).not.toBeNull();
|
||||
const event = unitTestingUtils.getByCSS('diagram-start-event > diagram-event > raphael-circle');
|
||||
expect(event?.injector.get(RaphaelCircleDirective).stroke).toBe('#017501');
|
||||
|
||||
const iconEvent: any = element.querySelector(
|
||||
const iconEvent = unitTestingUtils.getByCSS(
|
||||
'diagram-start-event > diagram-event >' +
|
||||
' diagram-container-icon-event > div > div > diagram-icon-timer > raphael-icon-timer'
|
||||
);
|
||||
expect(iconEvent).not.toBeNull();
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -325,17 +327,17 @@ describe('Diagrams events', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).toBeDefined();
|
||||
const event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle[ng-reflect-stroke="#2632aa"]');
|
||||
expect(event).not.toBeNull();
|
||||
const event = unitTestingUtils.getByCSS('diagram-start-event > diagram-event > raphael-circle');
|
||||
expect(event?.injector.get(RaphaelCircleDirective).stroke).toBe('#2632aa');
|
||||
|
||||
const iconEvent: any = element.querySelector(
|
||||
const iconEvent = unitTestingUtils.getByCSS(
|
||||
'diagram-start-event > diagram-event >' +
|
||||
' diagram-container-icon-event > div > div > diagram-icon-timer > raphael-icon-timer'
|
||||
);
|
||||
expect(iconEvent).not.toBeNull();
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -350,17 +352,17 @@ describe('Diagrams events', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).toBeDefined();
|
||||
const event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle');
|
||||
const event = unitTestingUtils.getByCSS('diagram-start-event > diagram-event > raphael-circle');
|
||||
expect(event).not.toBeNull();
|
||||
|
||||
const iconEvent: any = element.querySelector(
|
||||
const iconEvent = unitTestingUtils.getByCSS(
|
||||
'diagram-start-event > diagram-event >' +
|
||||
' diagram-container-icon-event > div > div > diagram-icon-signal > raphael-icon-signal'
|
||||
);
|
||||
expect(iconEvent).not.toBeNull();
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -374,17 +376,17 @@ describe('Diagrams events', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).toBeDefined();
|
||||
const event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle[ng-reflect-stroke="#017501"]');
|
||||
expect(event).not.toBeNull();
|
||||
const event = unitTestingUtils.getByCSS('diagram-start-event > diagram-event > raphael-circle');
|
||||
expect(event?.injector.get(RaphaelCircleDirective).stroke).toBe('#017501');
|
||||
|
||||
const iconEvent: any = element.querySelector(
|
||||
const iconEvent = unitTestingUtils.getByCSS(
|
||||
'diagram-start-event > diagram-event >' +
|
||||
' diagram-container-icon-event > div > div > diagram-icon-signal > raphael-icon-signal'
|
||||
);
|
||||
expect(iconEvent).not.toBeNull();
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -398,17 +400,17 @@ describe('Diagrams events', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).toBeDefined();
|
||||
const event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle[ng-reflect-stroke="#2632aa"]');
|
||||
expect(event).not.toBeNull();
|
||||
const event = unitTestingUtils.getByCSS('diagram-start-event > diagram-event > raphael-circle');
|
||||
expect(event?.injector.get(RaphaelCircleDirective).stroke).toBe('#2632aa');
|
||||
|
||||
const iconEvent: any = element.querySelector(
|
||||
const iconEvent = unitTestingUtils.getByCSS(
|
||||
'diagram-start-event > diagram-event >' +
|
||||
' diagram-container-icon-event > div > div > diagram-icon-signal > raphael-icon-signal'
|
||||
);
|
||||
expect(iconEvent).not.toBeNull();
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -422,17 +424,17 @@ describe('Diagrams events', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).toBeDefined();
|
||||
const event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle');
|
||||
const event = unitTestingUtils.getByCSS('diagram-start-event > diagram-event > raphael-circle');
|
||||
expect(event).not.toBeNull();
|
||||
|
||||
const iconEvent: any = element.querySelector(
|
||||
const iconEvent = unitTestingUtils.getByCSS(
|
||||
'diagram-start-event > diagram-event >' +
|
||||
' diagram-container-icon-event > div > div > diagram-icon-message > raphael-icon-message'
|
||||
);
|
||||
expect(iconEvent).not.toBeNull();
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -446,17 +448,17 @@ describe('Diagrams events', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).toBeDefined();
|
||||
const event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle[ng-reflect-stroke="#017501"]');
|
||||
expect(event).not.toBeNull();
|
||||
const event = unitTestingUtils.getByCSS('diagram-start-event > diagram-event > raphael-circle');
|
||||
expect(event?.injector.get(RaphaelCircleDirective).stroke).toBe('#017501');
|
||||
|
||||
const iconEvent: any = element.querySelector(
|
||||
const iconEvent = unitTestingUtils.getByCSS(
|
||||
'diagram-start-event > diagram-event >' +
|
||||
' diagram-container-icon-event > div > div > diagram-icon-message > raphael-icon-message'
|
||||
);
|
||||
expect(iconEvent).not.toBeNull();
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -470,17 +472,17 @@ describe('Diagrams events', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).toBeDefined();
|
||||
const event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle[ng-reflect-stroke="#2632aa"]');
|
||||
expect(event).not.toBeNull();
|
||||
const event = unitTestingUtils.getByCSS('diagram-start-event > diagram-event > raphael-circle');
|
||||
expect(event?.injector.get(RaphaelCircleDirective).stroke).toBe('#2632aa');
|
||||
|
||||
const iconEvent: any = element.querySelector(
|
||||
const iconEvent = unitTestingUtils.getByCSS(
|
||||
'diagram-start-event > diagram-event >' +
|
||||
' diagram-container-icon-event > div > div > diagram-icon-message > raphael-icon-message'
|
||||
);
|
||||
expect(iconEvent).not.toBeNull();
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -494,17 +496,17 @@ describe('Diagrams events', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).toBeDefined();
|
||||
const event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle');
|
||||
const event = unitTestingUtils.getByCSS('diagram-start-event > diagram-event > raphael-circle');
|
||||
expect(event).not.toBeNull();
|
||||
|
||||
const iconEvent: any = element.querySelector(
|
||||
const iconEvent = unitTestingUtils.getByCSS(
|
||||
'diagram-start-event > diagram-event >' +
|
||||
' diagram-container-icon-event > div > div > diagram-icon-error > raphael-icon-error'
|
||||
);
|
||||
expect(iconEvent).not.toBeNull();
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -518,17 +520,17 @@ describe('Diagrams events', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).toBeDefined();
|
||||
const event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle[ng-reflect-stroke="#017501"]');
|
||||
expect(event).not.toBeNull();
|
||||
const event = unitTestingUtils.getByCSS('diagram-start-event > diagram-event > raphael-circle');
|
||||
expect(event?.injector.get(RaphaelCircleDirective).stroke).toBe('#017501');
|
||||
|
||||
const iconEvent: any = element.querySelector(
|
||||
const iconEvent = unitTestingUtils.getByCSS(
|
||||
'diagram-start-event > diagram-event >' +
|
||||
' diagram-container-icon-event > div > div > diagram-icon-error > raphael-icon-error'
|
||||
);
|
||||
expect(iconEvent).not.toBeNull();
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -542,17 +544,17 @@ describe('Diagrams events', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).toBeDefined();
|
||||
const event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle[ng-reflect-stroke="#2632aa"]');
|
||||
expect(event).not.toBeNull();
|
||||
const event = unitTestingUtils.getByCSS('diagram-start-event > diagram-event > raphael-circle');
|
||||
expect(event?.injector.get(RaphaelCircleDirective).stroke).toBe('#2632aa');
|
||||
|
||||
const iconEvent: any = element.querySelector(
|
||||
const iconEvent = unitTestingUtils.getByCSS(
|
||||
'diagram-start-event > diagram-event >' +
|
||||
' diagram-container-icon-event > div > div > diagram-icon-error > raphael-icon-error'
|
||||
);
|
||||
expect(iconEvent).not.toBeNull();
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -566,11 +568,11 @@ describe('Diagrams events', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).toBeDefined();
|
||||
const event: any = element.querySelector('diagram-end-event > diagram-event > raphael-circle');
|
||||
const event = unitTestingUtils.getByCSS('diagram-end-event > diagram-event > raphael-circle');
|
||||
expect(event).not.toBeNull();
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -584,11 +586,11 @@ describe('Diagrams events', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).toBeDefined();
|
||||
const event: any = element.querySelector('diagram-end-event > diagram-event > raphael-circle[ng-reflect-stroke="#017501"]');
|
||||
expect(event).not.toBeNull();
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const event = unitTestingUtils.getByCSS('diagram-end-event > diagram-event > raphael-circle');
|
||||
expect(event?.injector.get(RaphaelCircleDirective).stroke).toBe('#017501');
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -602,11 +604,11 @@ describe('Diagrams events', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).toBeDefined();
|
||||
const event: any = element.querySelector('diagram-end-event > diagram-event > raphael-circle[ng-reflect-stroke="#2632aa"]');
|
||||
expect(event).not.toBeNull();
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const event = unitTestingUtils.getByCSS('diagram-end-event > diagram-event > raphael-circle');
|
||||
expect(event?.injector.get(RaphaelCircleDirective).stroke).toBe('#2632aa');
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -620,16 +622,16 @@ describe('Diagrams events', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).toBeDefined();
|
||||
const event: any = element.querySelector('diagram-end-event > diagram-event > raphael-circle');
|
||||
const event = unitTestingUtils.getByCSS('diagram-end-event > diagram-event > raphael-circle');
|
||||
expect(event).not.toBeNull();
|
||||
|
||||
const iconEvent: any = element.querySelector(
|
||||
const iconEvent = unitTestingUtils.getByCSS(
|
||||
'diagram-end-event > diagram-event >' + ' diagram-container-icon-event > div > div > diagram-icon-error > raphael-icon-error'
|
||||
);
|
||||
expect(iconEvent).not.toBeNull();
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -643,16 +645,16 @@ describe('Diagrams events', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).toBeDefined();
|
||||
const event: any = element.querySelector('diagram-end-event > diagram-event > raphael-circle[ng-reflect-stroke="#017501"]');
|
||||
expect(event).not.toBeNull();
|
||||
const event = unitTestingUtils.getByCSS('diagram-end-event > diagram-event > raphael-circle');
|
||||
expect(event?.injector.get(RaphaelCircleDirective).stroke).toBe('#017501');
|
||||
|
||||
const iconEvent: any = element.querySelector(
|
||||
const iconEvent = unitTestingUtils.getByCSS(
|
||||
'diagram-end-event > diagram-event >' + ' diagram-container-icon-event > div > div > diagram-icon-error > raphael-icon-error'
|
||||
);
|
||||
expect(iconEvent).not.toBeNull();
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -666,16 +668,16 @@ describe('Diagrams events', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).toBeDefined();
|
||||
const event: any = element.querySelector('diagram-end-event > diagram-event > raphael-circle[ng-reflect-stroke="#2632aa"]');
|
||||
expect(event).not.toBeNull();
|
||||
const event = unitTestingUtils.getByCSS('diagram-end-event > diagram-event > raphael-circle');
|
||||
expect(event?.injector.get(RaphaelCircleDirective).stroke).toBe('#2632aa');
|
||||
|
||||
const iconEvent: any = element.querySelector(
|
||||
const iconEvent = unitTestingUtils.getByCSS(
|
||||
'diagram-end-event > diagram-event >' + ' diagram-container-icon-event > div > div > diagram-icon-error > raphael-icon-error'
|
||||
);
|
||||
expect(iconEvent).not.toBeNull();
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -20,13 +20,15 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import * as diagramsGatewaysMock from '../../mock/diagram/diagram-gateways.mock';
|
||||
import { DiagramComponent } from './diagram.component';
|
||||
import { InsightsTestingModule } from '../../testing/insights.testing.module';
|
||||
import { UnitTestingUtils } from '@alfresco/adf-core';
|
||||
import { RaphaelRhombusDirective } from '@alfresco/adf-insights';
|
||||
|
||||
declare let jasmine: any;
|
||||
|
||||
describe('Diagrams gateways', () => {
|
||||
let component: any;
|
||||
let fixture: ComponentFixture<DiagramComponent>;
|
||||
let element: HTMLElement;
|
||||
let unitTestingUtils: UnitTestingUtils;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
@@ -34,7 +36,7 @@ describe('Diagrams gateways', () => {
|
||||
});
|
||||
fixture = TestBed.createComponent(DiagramComponent);
|
||||
component = fixture.componentInstance;
|
||||
element = fixture.nativeElement;
|
||||
unitTestingUtils = new UnitTestingUtils(fixture.debugElement);
|
||||
fixture.detectChanges();
|
||||
|
||||
jasmine.Ajax.install();
|
||||
@@ -63,15 +65,15 @@ describe('Diagrams gateways', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector('diagram-exclusive-gateway > diagram-gateway > raphael-rhombus');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-exclusive-gateway > diagram-gateway > raphael-rhombus');
|
||||
expect(shape).not.toBeNull();
|
||||
|
||||
const shape1: any = element.querySelector('diagram-exclusive-gateway > raphael-cross');
|
||||
const shape1 = unitTestingUtils.getByCSS('diagram-exclusive-gateway > raphael-cross');
|
||||
expect(shape1).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -85,15 +87,15 @@ describe('Diagrams gateways', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector('diagram-inclusive-gateway > diagram-gateway > raphael-rhombus');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-inclusive-gateway > diagram-gateway > raphael-rhombus');
|
||||
expect(shape).not.toBeNull();
|
||||
|
||||
const shape1: any = element.querySelector('diagram-inclusive-gateway > raphael-circle');
|
||||
const shape1 = unitTestingUtils.getByCSS('diagram-inclusive-gateway > raphael-circle');
|
||||
expect(shape1).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -107,15 +109,15 @@ describe('Diagrams gateways', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector('diagram-parallel-gateway > diagram-gateway > raphael-rhombus');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-parallel-gateway > diagram-gateway > raphael-rhombus');
|
||||
expect(shape).not.toBeNull();
|
||||
|
||||
const shape1: any = element.querySelector('diagram-parallel-gateway > raphael-plus');
|
||||
const shape1 = unitTestingUtils.getByCSS('diagram-parallel-gateway > raphael-plus');
|
||||
expect(shape1).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -129,25 +131,25 @@ describe('Diagrams gateways', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector('diagram-event-gateway > diagram-gateway > raphael-rhombus');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-event-gateway > diagram-gateway > raphael-rhombus');
|
||||
expect(shape).not.toBeNull();
|
||||
|
||||
const shape1: any = element.querySelector('diagram-event-gateway');
|
||||
const shape1 = unitTestingUtils.getByCSS('diagram-event-gateway');
|
||||
expect(shape1).not.toBeNull();
|
||||
expect(shape1.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape1.children[1];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape1.children[2];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const shape2: any = element.querySelector('diagram-event-gateway > raphael-pentagon');
|
||||
const shape2 = unitTestingUtils.getByCSS('diagram-event-gateway > raphael-pentagon');
|
||||
expect(shape2).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -163,15 +165,15 @@ describe('Diagrams gateways', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector('diagram-exclusive-gateway > diagram-gateway > raphael-rhombus');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-exclusive-gateway > diagram-gateway > raphael-rhombus');
|
||||
expect(shape).not.toBeNull();
|
||||
|
||||
const shape1: any = element.querySelector('diagram-exclusive-gateway > raphael-cross');
|
||||
const shape1 = unitTestingUtils.getByCSS('diagram-exclusive-gateway > raphael-cross');
|
||||
expect(shape1).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -185,17 +187,15 @@ describe('Diagrams gateways', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector(
|
||||
'diagram-exclusive-gateway > diagram-gateway > raphael-rhombus[ng-reflect-stroke="#017501"]'
|
||||
);
|
||||
expect(shape).not.toBeNull();
|
||||
const shape = unitTestingUtils.getByCSS('diagram-exclusive-gateway > diagram-gateway > raphael-rhombus');
|
||||
expect(shape.injector.get(RaphaelRhombusDirective).stroke).toBe('#017501');
|
||||
|
||||
const shape1: any = element.querySelector('diagram-exclusive-gateway > raphael-cross');
|
||||
const shape1 = unitTestingUtils.getByCSS('diagram-exclusive-gateway > raphael-cross');
|
||||
expect(shape1).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -209,17 +209,15 @@ describe('Diagrams gateways', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector(
|
||||
'diagram-exclusive-gateway > diagram-gateway > raphael-rhombus[ng-reflect-stroke="#2632aa"]'
|
||||
);
|
||||
expect(shape).not.toBeNull();
|
||||
const shape = unitTestingUtils.getByCSS('diagram-exclusive-gateway > diagram-gateway > raphael-rhombus');
|
||||
expect(shape.injector.get(RaphaelRhombusDirective).stroke).toBe('#2632aa');
|
||||
|
||||
const shape1: any = element.querySelector('diagram-exclusive-gateway > raphael-cross');
|
||||
const shape1 = unitTestingUtils.getByCSS('diagram-exclusive-gateway > raphael-cross');
|
||||
expect(shape1).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -233,15 +231,15 @@ describe('Diagrams gateways', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector('diagram-inclusive-gateway > diagram-gateway > raphael-rhombus');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-inclusive-gateway > diagram-gateway > raphael-rhombus');
|
||||
expect(shape).not.toBeNull();
|
||||
|
||||
const shape1: any = element.querySelector('diagram-inclusive-gateway > raphael-circle');
|
||||
const shape1 = unitTestingUtils.getByCSS('diagram-inclusive-gateway > raphael-circle');
|
||||
expect(shape1).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -255,17 +253,15 @@ describe('Diagrams gateways', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector(
|
||||
'diagram-inclusive-gateway > diagram-gateway > raphael-rhombus[ng-reflect-stroke="#017501"]'
|
||||
);
|
||||
expect(shape).not.toBeNull();
|
||||
const shape = unitTestingUtils.getByCSS('diagram-inclusive-gateway > diagram-gateway > raphael-rhombus');
|
||||
expect(shape.injector.get(RaphaelRhombusDirective).stroke).toBe('#017501');
|
||||
|
||||
const shape1: any = element.querySelector('diagram-inclusive-gateway > raphael-circle');
|
||||
const shape1 = unitTestingUtils.getByCSS('diagram-inclusive-gateway > raphael-circle');
|
||||
expect(shape1).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -279,17 +275,15 @@ describe('Diagrams gateways', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector(
|
||||
'diagram-inclusive-gateway > diagram-gateway > raphael-rhombus[ng-reflect-stroke="#2632aa"]'
|
||||
);
|
||||
expect(shape).not.toBeNull();
|
||||
const shape = unitTestingUtils.getByCSS('diagram-inclusive-gateway > diagram-gateway > raphael-rhombus');
|
||||
expect(shape.injector.get(RaphaelRhombusDirective).stroke).toBe('#2632aa');
|
||||
|
||||
const shape1: any = element.querySelector('diagram-inclusive-gateway > raphael-circle');
|
||||
const shape1 = unitTestingUtils.getByCSS('diagram-inclusive-gateway > raphael-circle');
|
||||
expect(shape1).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -303,15 +297,15 @@ describe('Diagrams gateways', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector('diagram-parallel-gateway > diagram-gateway > raphael-rhombus');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-parallel-gateway > diagram-gateway > raphael-rhombus');
|
||||
expect(shape).not.toBeNull();
|
||||
|
||||
const shape1: any = element.querySelector('diagram-parallel-gateway > raphael-plus');
|
||||
const shape1 = unitTestingUtils.getByCSS('diagram-parallel-gateway > raphael-plus');
|
||||
expect(shape1).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -325,17 +319,15 @@ describe('Diagrams gateways', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector(
|
||||
'diagram-parallel-gateway > diagram-gateway > raphael-rhombus[ng-reflect-stroke="#017501"]'
|
||||
);
|
||||
expect(shape).not.toBeNull();
|
||||
const shape = unitTestingUtils.getByCSS('diagram-parallel-gateway > diagram-gateway > raphael-rhombus');
|
||||
expect(shape.injector.get(RaphaelRhombusDirective).stroke).toBe('#017501');
|
||||
|
||||
const shape1: any = element.querySelector('diagram-parallel-gateway > raphael-plus');
|
||||
const shape1 = unitTestingUtils.getByCSS('diagram-parallel-gateway > raphael-plus');
|
||||
expect(shape1).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -349,17 +341,15 @@ describe('Diagrams gateways', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector(
|
||||
'diagram-parallel-gateway > diagram-gateway > raphael-rhombus[ng-reflect-stroke="#2632aa"]'
|
||||
);
|
||||
expect(shape).not.toBeNull();
|
||||
const shape = unitTestingUtils.getByCSS('diagram-parallel-gateway > diagram-gateway > raphael-rhombus');
|
||||
expect(shape.injector.get(RaphaelRhombusDirective).stroke).toBe('#2632aa');
|
||||
|
||||
const shape1: any = element.querySelector('diagram-parallel-gateway > raphael-plus');
|
||||
const shape1 = unitTestingUtils.getByCSS('diagram-parallel-gateway > raphael-plus');
|
||||
expect(shape1).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -373,25 +363,25 @@ describe('Diagrams gateways', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector('diagram-event-gateway > diagram-gateway > raphael-rhombus');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-event-gateway > diagram-gateway > raphael-rhombus');
|
||||
expect(shape).not.toBeNull();
|
||||
|
||||
const shape1: any = element.querySelector('diagram-event-gateway');
|
||||
const shape1 = unitTestingUtils.getByCSS('diagram-event-gateway');
|
||||
expect(shape1).not.toBeNull();
|
||||
expect(shape1.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape1.children[1];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape1.children[2];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const shape2: any = element.querySelector('diagram-event-gateway > raphael-pentagon');
|
||||
const shape2 = unitTestingUtils.getByCSS('diagram-event-gateway > raphael-pentagon');
|
||||
expect(shape2).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -405,27 +395,25 @@ describe('Diagrams gateways', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector(
|
||||
'diagram-event-gateway > diagram-gateway > raphael-rhombus[ng-reflect-stroke="#017501"]'
|
||||
);
|
||||
expect(shape).not.toBeNull();
|
||||
const shape = unitTestingUtils.getByCSS('diagram-event-gateway > diagram-gateway > raphael-rhombus');
|
||||
expect(shape.injector.get(RaphaelRhombusDirective).stroke).toBe('#017501');
|
||||
|
||||
const shape1: any = element.querySelector('diagram-event-gateway');
|
||||
const shape1 = unitTestingUtils.getByCSS('diagram-event-gateway');
|
||||
expect(shape1).not.toBeNull();
|
||||
expect(shape1.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape1.children[1];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape1.children[2];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const shape2: any = element.querySelector('diagram-event-gateway > raphael-pentagon');
|
||||
const shape2 = unitTestingUtils.getByCSS('diagram-event-gateway > raphael-pentagon');
|
||||
expect(shape2).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -439,27 +427,25 @@ describe('Diagrams gateways', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector(
|
||||
'diagram-event-gateway > diagram-gateway > raphael-rhombus[ng-reflect-stroke="#2632aa"]'
|
||||
);
|
||||
expect(shape).not.toBeNull();
|
||||
const shape = unitTestingUtils.getByCSS('diagram-event-gateway > diagram-gateway > raphael-rhombus');
|
||||
expect(shape.injector.get(RaphaelRhombusDirective).stroke).toBe('#2632aa');
|
||||
|
||||
const shape1: any = element.querySelector('diagram-event-gateway');
|
||||
const shape1 = unitTestingUtils.getByCSS('diagram-event-gateway');
|
||||
expect(shape1).not.toBeNull();
|
||||
expect(shape1.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape1.children[1];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape1.children[2];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const shape2: any = element.querySelector('diagram-event-gateway > raphael-pentagon');
|
||||
const shape2 = unitTestingUtils.getByCSS('diagram-event-gateway > raphael-pentagon');
|
||||
expect(shape2).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -19,13 +19,15 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import * as structuralMock from '../../mock/diagram/diagram-structural.mock';
|
||||
import { DiagramComponent } from './diagram.component';
|
||||
import { InsightsTestingModule } from '../../testing/insights.testing.module';
|
||||
import { UnitTestingUtils } from '@alfresco/adf-core';
|
||||
import { RaphaelRectDirective } from '@alfresco/adf-insights';
|
||||
|
||||
declare let jasmine: any;
|
||||
|
||||
describe('Diagrams structural', () => {
|
||||
let component: any;
|
||||
let fixture: ComponentFixture<DiagramComponent>;
|
||||
let element: HTMLElement;
|
||||
let unitTestingUtils: UnitTestingUtils;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
@@ -33,8 +35,8 @@ describe('Diagrams structural', () => {
|
||||
});
|
||||
fixture = TestBed.createComponent(DiagramComponent);
|
||||
component = fixture.componentInstance;
|
||||
element = fixture.nativeElement;
|
||||
fixture.detectChanges();
|
||||
unitTestingUtils = new UnitTestingUtils(fixture.debugElement);
|
||||
|
||||
jasmine.Ajax.install();
|
||||
component.processInstanceId = '38399';
|
||||
@@ -62,12 +64,12 @@ describe('Diagrams structural', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector('diagram-subprocess > raphael-rect');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-subprocess > raphael-rect');
|
||||
expect(shape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -81,12 +83,12 @@ describe('Diagrams structural', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector('diagram-event-subprocess > raphael-rect');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-event-subprocess > raphael-rect');
|
||||
expect(shape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -102,12 +104,12 @@ describe('Diagrams structural', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector('diagram-subprocess > raphael-rect');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-subprocess > raphael-rect');
|
||||
expect(shape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -121,12 +123,12 @@ describe('Diagrams structural', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector('diagram-subprocess > raphael-rect[ng-reflect-stroke="#017501"]');
|
||||
expect(shape).not.toBeNull();
|
||||
const shape = unitTestingUtils.getByCSS('diagram-subprocess > raphael-rect');
|
||||
expect(shape.injector.get(RaphaelRectDirective).stroke).toBe('#017501');
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -140,12 +142,12 @@ describe('Diagrams structural', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector('diagram-subprocess > raphael-rect[ng-reflect-stroke="#2632aa"]');
|
||||
expect(shape).not.toBeNull();
|
||||
const shape = unitTestingUtils.getByCSS('diagram-subprocess > raphael-rect');
|
||||
expect(shape.injector.get(RaphaelRectDirective).stroke).toBe('#2632aa');
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -159,12 +161,12 @@ describe('Diagrams structural', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector('diagram-event-subprocess > raphael-rect');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-event-subprocess > raphael-rect');
|
||||
expect(shape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -178,12 +180,12 @@ describe('Diagrams structural', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector('diagram-event-subprocess > raphael-rect[ng-reflect-stroke="#017501"]');
|
||||
expect(shape).not.toBeNull();
|
||||
const shape = unitTestingUtils.getByCSS('diagram-event-subprocess > raphael-rect');
|
||||
expect(shape.injector.get(RaphaelRectDirective).stroke).toBe('#017501');
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -197,12 +199,12 @@ describe('Diagrams structural', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector('diagram-event-subprocess > raphael-rect[ng-reflect-stroke="#2632aa"]');
|
||||
expect(shape).not.toBeNull();
|
||||
const shape = unitTestingUtils.getByCSS('diagram-event-subprocess > raphael-rect');
|
||||
expect(shape.injector.get(RaphaelRectDirective).stroke).toBe('#2632aa');
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -19,13 +19,15 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import * as swimLanesMock from '../../mock/diagram/diagram-swimlanes.mock';
|
||||
import { DiagramComponent } from './diagram.component';
|
||||
import { InsightsTestingModule } from '../../testing/insights.testing.module';
|
||||
import { UnitTestingUtils } from '@alfresco/adf-core';
|
||||
import { RaphaelTextDirective } from '@alfresco/adf-insights';
|
||||
|
||||
declare let jasmine: any;
|
||||
|
||||
describe('Diagrams swim', () => {
|
||||
let component: any;
|
||||
let fixture: ComponentFixture<DiagramComponent>;
|
||||
let element: HTMLElement;
|
||||
let unitTestingUtils: UnitTestingUtils;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
@@ -33,8 +35,8 @@ describe('Diagrams swim', () => {
|
||||
});
|
||||
fixture = TestBed.createComponent(DiagramComponent);
|
||||
component = fixture.componentInstance;
|
||||
element = fixture.nativeElement;
|
||||
fixture.detectChanges();
|
||||
unitTestingUtils = new UnitTestingUtils(fixture.debugElement);
|
||||
|
||||
jasmine.Ajax.install();
|
||||
component.processInstanceId = '38399';
|
||||
@@ -62,12 +64,12 @@ describe('Diagrams swim', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector('diagram-pool > raphael-rect');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-pool > raphael-rect');
|
||||
expect(shape).not.toBeNull();
|
||||
|
||||
const shapeText: any = element.querySelector('diagram-pool > raphael-text');
|
||||
const shapeText = unitTestingUtils.getByCSS('diagram-pool > raphael-text');
|
||||
expect(shapeText).not.toBeNull();
|
||||
expect(shapeText.attributes.getNamedItem('ng-reflect-text').value).toEqual('Activiti');
|
||||
expect(shapeText.injector.get(RaphaelTextDirective).text).toEqual('Activiti');
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -81,15 +83,15 @@ describe('Diagrams swim', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shapeLane: any = element.querySelector('diagram-lanes > div > div > diagram-lane');
|
||||
const shapeLane = unitTestingUtils.getByCSS('diagram-lanes > div > div > diagram-lane');
|
||||
expect(shapeLane).not.toBeNull();
|
||||
|
||||
const shapeRect: any = element.querySelector('diagram-lanes > div > div > diagram-lane > raphael-rect');
|
||||
const shapeRect = unitTestingUtils.getByCSS('diagram-lanes > div > div > diagram-lane > raphael-rect');
|
||||
expect(shapeRect).not.toBeNull();
|
||||
|
||||
const shapeText: any = element.querySelector('diagram-lanes > div > div > diagram-lane > raphael-text');
|
||||
const shapeText = unitTestingUtils.getByCSS('diagram-lanes > div > div > diagram-lane > raphael-text');
|
||||
expect(shapeText).not.toBeNull();
|
||||
expect(shapeText.attributes.getNamedItem('ng-reflect-text').value).toEqual('Backend');
|
||||
expect(shapeText.injector.get(RaphaelTextDirective).text).toEqual('Backend');
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -105,12 +107,12 @@ describe('Diagrams swim', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector('diagram-pool > raphael-rect');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-pool > raphael-rect');
|
||||
expect(shape).not.toBeNull();
|
||||
|
||||
const shapeText: any = element.querySelector('diagram-pool > raphael-text');
|
||||
const shapeText = unitTestingUtils.getByCSS('diagram-pool > raphael-text');
|
||||
expect(shapeText).not.toBeNull();
|
||||
expect(shapeText.attributes.getNamedItem('ng-reflect-text').value).toEqual('Activiti');
|
||||
expect(shapeText.injector.get(RaphaelTextDirective).text).toEqual('Activiti');
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -124,15 +126,15 @@ describe('Diagrams swim', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shapeLane: any = element.querySelector('diagram-lanes > div > div > diagram-lane');
|
||||
const shapeLane = unitTestingUtils.getByCSS('diagram-lanes > div > div > diagram-lane');
|
||||
expect(shapeLane).not.toBeNull();
|
||||
|
||||
const shapeRect: any = element.querySelector('diagram-lanes > div > div > diagram-lane > raphael-rect');
|
||||
const shapeRect = unitTestingUtils.getByCSS('diagram-lanes > div > div > diagram-lane > raphael-rect');
|
||||
expect(shapeRect).not.toBeNull();
|
||||
|
||||
const shapeText: any = element.querySelector('diagram-lanes > div > div > diagram-lane > raphael-text');
|
||||
const shapeText = unitTestingUtils.getByCSS('diagram-lanes > div > div > diagram-lane > raphael-text');
|
||||
expect(shapeText).not.toBeNull();
|
||||
expect(shapeText.attributes.getNamedItem('ng-reflect-text').value).toEqual('Backend');
|
||||
expect(shapeText.injector.get(RaphaelTextDirective).text).toEqual('Backend');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -19,13 +19,15 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import * as throwEventMock from '../../mock/diagram/diagram-throw.mock';
|
||||
import { DiagramComponent } from './diagram.component';
|
||||
import { InsightsTestingModule } from '../../testing/insights.testing.module';
|
||||
import { UnitTestingUtils } from '@alfresco/adf-core';
|
||||
import { RaphaelCircleDirective } from '@alfresco/adf-insights';
|
||||
|
||||
declare let jasmine: any;
|
||||
|
||||
describe('Diagrams throw', () => {
|
||||
let component: any;
|
||||
let fixture: ComponentFixture<DiagramComponent>;
|
||||
let element: HTMLElement;
|
||||
let unitTestingUtils: UnitTestingUtils;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
@@ -35,7 +37,7 @@ describe('Diagrams throw', () => {
|
||||
|
||||
fixture = TestBed.createComponent(DiagramComponent);
|
||||
component = fixture.componentInstance;
|
||||
element = fixture.nativeElement;
|
||||
unitTestingUtils = new UnitTestingUtils(fixture.debugElement);
|
||||
component.processInstanceId = '38399';
|
||||
component.processDefinitionId = 'fakeprocess:24:38399';
|
||||
component.metricPercentages = { startEvent: 0 };
|
||||
@@ -62,17 +64,17 @@ describe('Diagrams throw', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector('diagram-throw-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-throw-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-throw-event > diagram-container-icon-event >' + ' div > div > diagram-icon-timer'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
@@ -90,20 +92,20 @@ describe('Diagrams throw', () => {
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
|
||||
const coloredShape: any = element.querySelector('diagram-throw-event>raphael-circle[ng-reflect-stroke="#017501"]');
|
||||
expect(coloredShape).not.toBeNull();
|
||||
const coloredShape = unitTestingUtils.getByCSS('diagram-throw-event>raphael-circle');
|
||||
expect(coloredShape.injector.get(RaphaelCircleDirective).stroke).toBe('#017501');
|
||||
|
||||
const shape: any = element.querySelector('diagram-throw-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-throw-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-throw-event > diagram-container-icon-event >' + ' div > div > diagram-icon-timer'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
@@ -121,20 +123,20 @@ describe('Diagrams throw', () => {
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
|
||||
const coloredShape: any = element.querySelector('diagram-throw-event>raphael-circle[ng-reflect-stroke="#2632aa"]');
|
||||
expect(coloredShape).not.toBeNull();
|
||||
const coloredShape = unitTestingUtils.getByCSS('diagram-throw-event>raphael-circle');
|
||||
expect(coloredShape.injector.get(RaphaelCircleDirective).stroke).toBe('#2632aa');
|
||||
|
||||
const shape: any = element.querySelector('diagram-throw-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-throw-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-throw-event > diagram-container-icon-event >' + ' div > div > diagram-icon-timer'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
@@ -151,24 +153,24 @@ describe('Diagrams throw', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector('diagram-throw-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-throw-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-throw-event > diagram-container-icon-event >' + ' div > div > diagram-icon-error'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -183,27 +185,27 @@ describe('Diagrams throw', () => {
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
|
||||
const coloredShape: any = element.querySelector('diagram-throw-event>raphael-circle[ng-reflect-stroke="#017501"]');
|
||||
expect(coloredShape).not.toBeNull();
|
||||
const coloredShape = unitTestingUtils.getByCSS('diagram-throw-event>raphael-circle');
|
||||
expect(coloredShape.injector.get(RaphaelCircleDirective).stroke).toBe('#017501');
|
||||
|
||||
const shape: any = element.querySelector('diagram-throw-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-throw-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-throw-event > diagram-container-icon-event >' + ' div > div > diagram-icon-error'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -218,27 +220,27 @@ describe('Diagrams throw', () => {
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
|
||||
const coloredShape: any = element.querySelector('diagram-throw-event>raphael-circle[ng-reflect-stroke="#2632aa"]');
|
||||
expect(coloredShape).not.toBeNull();
|
||||
const coloredShape = unitTestingUtils.getByCSS('diagram-throw-event>raphael-circle');
|
||||
expect(coloredShape.injector.get(RaphaelCircleDirective).stroke).toBe('#2632aa');
|
||||
|
||||
const shape: any = element.querySelector('diagram-throw-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-throw-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-throw-event > diagram-container-icon-event >' + ' div > div > diagram-icon-error'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -252,24 +254,24 @@ describe('Diagrams throw', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector('diagram-throw-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-throw-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-throw-event > diagram-container-icon-event >' + ' div > div > diagram-icon-signal'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -284,27 +286,27 @@ describe('Diagrams throw', () => {
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
|
||||
const coloredShape: any = element.querySelector('diagram-throw-event>raphael-circle[ng-reflect-stroke="#017501"]');
|
||||
expect(coloredShape).not.toBeNull();
|
||||
const coloredShape = unitTestingUtils.getByCSS('diagram-throw-event>raphael-circle');
|
||||
expect(coloredShape.injector.get(RaphaelCircleDirective).stroke).toBe('#017501');
|
||||
|
||||
const shape: any = element.querySelector('diagram-throw-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-throw-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-throw-event > diagram-container-icon-event >' + ' div > div > diagram-icon-signal'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -319,27 +321,27 @@ describe('Diagrams throw', () => {
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
|
||||
const coloredShape: any = element.querySelector('diagram-throw-event>raphael-circle[ng-reflect-stroke="#2632aa"]');
|
||||
expect(coloredShape).not.toBeNull();
|
||||
const coloredShape = unitTestingUtils.getByCSS('diagram-throw-event>raphael-circle');
|
||||
expect(coloredShape.injector.get(RaphaelCircleDirective).stroke).toBe('#2632aa');
|
||||
|
||||
const shape: any = element.querySelector('diagram-throw-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-throw-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-throw-event > diagram-container-icon-event >' + ' div > div > diagram-icon-signal'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -353,24 +355,24 @@ describe('Diagrams throw', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector('diagram-throw-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-throw-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-throw-event > diagram-container-icon-event >' + ' div > div > diagram-icon-message'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -385,27 +387,27 @@ describe('Diagrams throw', () => {
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
|
||||
const coloredShape: any = element.querySelector('diagram-throw-event>raphael-circle[ng-reflect-stroke="#017501"]');
|
||||
expect(coloredShape).not.toBeNull();
|
||||
const coloredShape = unitTestingUtils.getByCSS('diagram-throw-event>raphael-circle');
|
||||
expect(coloredShape.injector.get(RaphaelCircleDirective).stroke).toBe('#017501');
|
||||
|
||||
const shape: any = element.querySelector('diagram-throw-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-throw-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-throw-event > diagram-container-icon-event >' + ' div > div > diagram-icon-message'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -420,27 +422,27 @@ describe('Diagrams throw', () => {
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
|
||||
const coloredShape: any = element.querySelector('diagram-throw-event>raphael-circle[ng-reflect-stroke="#2632aa"]');
|
||||
expect(coloredShape).not.toBeNull();
|
||||
const coloredShape = unitTestingUtils.getByCSS('diagram-throw-event>raphael-circle');
|
||||
expect(coloredShape.injector.get(RaphaelCircleDirective).stroke).toBe('#2632aa');
|
||||
|
||||
const shape: any = element.querySelector('diagram-throw-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-throw-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-throw-event > diagram-container-icon-event >' + ' div > div > diagram-icon-message'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -454,24 +456,24 @@ describe('Diagrams throw', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector('diagram-throw-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-throw-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-throw-event > diagram-container-icon-event >' + ' div > div > diagram-icon-message'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -486,27 +488,27 @@ describe('Diagrams throw', () => {
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
|
||||
const coloredShape: any = element.querySelector('diagram-throw-event>raphael-circle[ng-reflect-stroke="#017501"]');
|
||||
expect(coloredShape).not.toBeNull();
|
||||
const coloredShape = unitTestingUtils.getByCSS('diagram-throw-event>raphael-circle');
|
||||
expect(coloredShape.injector.get(RaphaelCircleDirective).stroke).toBe('#017501');
|
||||
|
||||
const shape: any = element.querySelector('diagram-throw-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-throw-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-throw-event > diagram-container-icon-event >' + ' div > div > diagram-icon-message'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -521,27 +523,27 @@ describe('Diagrams throw', () => {
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
|
||||
const coloredShape: any = element.querySelector('diagram-throw-event>raphael-circle[ng-reflect-stroke="#2632aa"]');
|
||||
expect(coloredShape).not.toBeNull();
|
||||
const coloredShape = unitTestingUtils.getByCSS('diagram-throw-event>raphael-circle');
|
||||
expect(coloredShape.injector.get(RaphaelCircleDirective).stroke).toBe('#2632aa');
|
||||
|
||||
const shape: any = element.querySelector('diagram-throw-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-throw-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-throw-event > diagram-container-icon-event >' + ' div > div > diagram-icon-message'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -557,17 +559,17 @@ describe('Diagrams throw', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector('diagram-throw-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-throw-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-throw-event > diagram-container-icon-event >' + ' div > div > diagram-icon-timer'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
@@ -584,24 +586,24 @@ describe('Diagrams throw', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector('diagram-throw-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-throw-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-throw-event > diagram-container-icon-event >' + ' div > div > diagram-icon-error'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -615,24 +617,24 @@ describe('Diagrams throw', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector('diagram-throw-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-throw-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-throw-event > diagram-container-icon-event >' + ' div > div > diagram-icon-signal'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -646,24 +648,24 @@ describe('Diagrams throw', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector('diagram-throw-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-throw-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-throw-event > diagram-container-icon-event >' + ' div > div > diagram-icon-message'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -677,24 +679,24 @@ describe('Diagrams throw', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(res).not.toBeNull();
|
||||
const shape: any = element.querySelector('diagram-throw-event');
|
||||
const shape = unitTestingUtils.getByCSS('diagram-throw-event');
|
||||
expect(shape).not.toBeNull();
|
||||
expect(shape.children.length).toBe(4);
|
||||
|
||||
const outerCircle = shape.children[0];
|
||||
expect(outerCircle.localName).toEqual('raphael-circle');
|
||||
expect(outerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const innerCircle = shape.children[1];
|
||||
expect(innerCircle.localName).toEqual('raphael-circle');
|
||||
expect(innerCircle.nativeElement.localName).toEqual('raphael-circle');
|
||||
|
||||
const iconShape: any = element.querySelector(
|
||||
const iconShape = unitTestingUtils.getByCSS(
|
||||
'diagram-throw-event > diagram-container-icon-event >' + ' div > div > diagram-icon-message'
|
||||
);
|
||||
expect(iconShape).not.toBeNull();
|
||||
|
||||
const tooltip: any = element.querySelector('diagram-tooltip > div');
|
||||
expect(tooltip.textContent).toContain(res.elements[0].id);
|
||||
expect(tooltip.textContent).toContain(res.elements[0].type);
|
||||
const tooltip = unitTestingUtils.getInnerTextByCSS('diagram-tooltip > div');
|
||||
expect(tooltip).toContain(res.elements[0].id);
|
||||
expect(tooltip).toContain(res.elements[0].type);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user