mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-04-23 22:30:37 +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:
@@ -193,6 +193,10 @@ module.exports = {
|
||||
{
|
||||
selector: 'TSEnumDeclaration',
|
||||
message: 'Enums are not allowed. Use string literal types (e.g., type Foo = "a" | "b") or const objects instead.'
|
||||
},
|
||||
{
|
||||
selector: 'Literal[value=/^ng-reflect-/]',
|
||||
message: 'ng-reflect-* attributes should not be used. Consider alternatives for proper selectors.'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -17,14 +17,16 @@
|
||||
|
||||
import { DEFAULT_DATETIME_FORMAT, SearchDatetimeRangeComponent } from './search-datetime-range.component';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { MatDatetimepickerInputEvent } from '@mat-datetimepicker/core';
|
||||
import { DateFnsUtils } from '@alfresco/adf-core';
|
||||
import { MatDatetimepickerInputDirective, MatDatetimepickerInputEvent } from '@mat-datetimepicker/core';
|
||||
import { DateFnsUtils, UnitTestingUtils } from '@alfresco/adf-core';
|
||||
import { endOfMinute, isValid, startOfMinute } from 'date-fns';
|
||||
import { ReplaySubject } from 'rxjs';
|
||||
|
||||
describe('SearchDatetimeRangeComponent', () => {
|
||||
let fixture: ComponentFixture<SearchDatetimeRangeComponent>;
|
||||
let component: SearchDatetimeRangeComponent;
|
||||
let unitTestingUtils: UnitTestingUtils;
|
||||
|
||||
const fromDatetime = new Date('2016-10-16 12:30');
|
||||
const toDatetime = new Date('2017-10-16 20:00');
|
||||
const datetimeFormatFixture = 'DD-MMM-YY HH:mm'; // dd-MMM-yy HH:mm
|
||||
@@ -35,6 +37,7 @@ describe('SearchDatetimeRangeComponent', () => {
|
||||
imports: [SearchDatetimeRangeComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(SearchDatetimeRangeComponent);
|
||||
unitTestingUtils = new UnitTestingUtils(fixture.debugElement);
|
||||
component = fixture.componentInstance;
|
||||
component.id = 'createdDateRange';
|
||||
component.context = {
|
||||
@@ -207,8 +210,7 @@ describe('SearchDatetimeRangeComponent', () => {
|
||||
it('should have no maximum datetime by default', async () => {
|
||||
fixture.detectChanges();
|
||||
await fixture.whenStable();
|
||||
|
||||
expect(fixture.debugElement.nativeElement.querySelector('input[ng-reflect-max]')).toBeNull();
|
||||
expect(unitTestingUtils.getByCSS('input').injector.get(MatDatetimepickerInputDirective).max).toBeNull();
|
||||
});
|
||||
|
||||
it('should be able to set a fixed maximum datetime', async () => {
|
||||
@@ -217,12 +219,15 @@ describe('SearchDatetimeRangeComponent', () => {
|
||||
fixture.detectChanges();
|
||||
await fixture.whenStable();
|
||||
|
||||
const inputs = fixture.debugElement.nativeElement.querySelectorAll('input[ng-reflect-max]');
|
||||
const inputs = unitTestingUtils.getAllByCSS('input');
|
||||
|
||||
expect(inputs[0]).toBeDefined();
|
||||
expect(inputs[0]).not.toBeNull();
|
||||
expect(inputs[1]).toBeDefined();
|
||||
expect(inputs[1]).not.toBeNull();
|
||||
const [input1, input2] = inputs;
|
||||
expect(input1).toBeDefined();
|
||||
expect(input1).not.toBeNull();
|
||||
expect(input1.injector.get(MatDatetimepickerInputDirective).max).toBeDefined();
|
||||
expect(input2).toBeDefined();
|
||||
expect(input2).not.toBeNull();
|
||||
expect(input2.injector.get(MatDatetimepickerInputDirective).max).toBeDefined();
|
||||
});
|
||||
|
||||
it('should populate filter state when populate filters event has been observed', () => {
|
||||
|
||||
@@ -27,6 +27,7 @@ import { HarnessLoader } from '@angular/cdk/testing';
|
||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
import { addMinutes } from 'date-fns';
|
||||
import { UnitTestingUtils } from '../../../testing/unit-testing-utils';
|
||||
import { MatFormField } from '@angular/material/form-field';
|
||||
|
||||
describe('CardViewDateItemComponent', () => {
|
||||
let loader: HarnessLoader;
|
||||
@@ -372,14 +373,10 @@ describe('CardViewDateItemComponent', () => {
|
||||
component.editable = true;
|
||||
fixture.detectChanges();
|
||||
|
||||
const matFormField = await testingUtils.getMatFormField();
|
||||
const host = await matFormField.host();
|
||||
const floatLabel = await host.getAttribute('ng-reflect-float-label');
|
||||
|
||||
expect(floatLabel).toBe('always');
|
||||
expect(testingUtils.getByDirective(MatFormField).componentInstance.floatLabel).toBe('always');
|
||||
});
|
||||
|
||||
it('should set floatLabel to null when property has no default value and is editable', async () => {
|
||||
it('should set floatLabel to auto when property has no default value and is editable', async () => {
|
||||
component.property = new CardViewDateItemModel({
|
||||
label: 'Date label',
|
||||
value: new Date('07/10/2017'),
|
||||
@@ -391,14 +388,10 @@ describe('CardViewDateItemComponent', () => {
|
||||
component.editable = true;
|
||||
fixture.detectChanges();
|
||||
|
||||
const matFormField = await testingUtils.getMatFormField();
|
||||
const host = await matFormField.host();
|
||||
const floatLabel = await host.getAttribute('ng-reflect-float-label');
|
||||
|
||||
expect(floatLabel).toBe(null);
|
||||
expect(testingUtils.getByDirective(MatFormField).componentInstance.floatLabel).toBe('auto');
|
||||
});
|
||||
|
||||
it('should set floatLabel to null when property has null default value and is editable', async () => {
|
||||
it('should set floatLabel to auto when property has null default value and is editable', async () => {
|
||||
component.property = new CardViewDateItemModel({
|
||||
label: 'Date label',
|
||||
value: new Date('07/10/2017'),
|
||||
@@ -409,12 +402,7 @@ describe('CardViewDateItemComponent', () => {
|
||||
});
|
||||
component.editable = true;
|
||||
fixture.detectChanges();
|
||||
|
||||
const matFormField = await testingUtils.getMatFormField();
|
||||
const host = await matFormField.host();
|
||||
const floatLabel = await host.getAttribute('ng-reflect-float-label');
|
||||
|
||||
expect(floatLabel).toBe(null);
|
||||
expect(testingUtils.getByDirective(MatFormField).componentInstance.floatLabel).toBe('auto');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -16,9 +16,10 @@
|
||||
*/
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { NavbarItemComponent } from './navbar-item.component';
|
||||
import { UnitTestingUtils } from '../../testing/unit-testing-utils';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { Router } from '@angular/router';
|
||||
import { UnitTestingUtils } from '@alfresco/adf-core';
|
||||
|
||||
describe('NavbarItemComponent', () => {
|
||||
let component: NavbarItemComponent;
|
||||
@@ -46,8 +47,11 @@ describe('NavbarItemComponent', () => {
|
||||
expect(button.textContent).toContain('Test Label');
|
||||
});
|
||||
|
||||
it('should bind routerLink', () => {
|
||||
it('should navigate to routerLink on click', () => {
|
||||
const navigateByUrlSpy = spyOn(TestBed.inject(Router), 'navigateByUrl');
|
||||
|
||||
button.click();
|
||||
fixture.detectChanges();
|
||||
expect(button.getAttribute('ng-reflect-router-link')).toEqual('/expected-route');
|
||||
expect(navigateByUrlSpy.calls.mostRecent().args[0].toString()).toBe('/expected-route');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -21,6 +21,7 @@ import { CommonModule } from '@angular/common';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { NavbarComponent } from './navbar.component';
|
||||
import { UnitTestingUtils } from '../../testing/unit-testing-utils';
|
||||
import { NavbarItemComponent } from '@alfresco/adf-core';
|
||||
|
||||
describe('NavbarComponent', () => {
|
||||
let component: NavbarComponent;
|
||||
@@ -45,8 +46,7 @@ describe('NavbarComponent', () => {
|
||||
];
|
||||
component.items = testItems;
|
||||
fixture.detectChanges();
|
||||
const renderedItems = testingUtils.getAllByCSS('.adf-navbar-item-btn');
|
||||
expect(renderedItems.length).toBe(testItems.length);
|
||||
expect(testingUtils.getAllByDirective(NavbarItemComponent).length).toBe(testItems.length);
|
||||
});
|
||||
|
||||
it('should render navbar items with correct label and router-link', () => {
|
||||
@@ -56,10 +56,10 @@ describe('NavbarComponent', () => {
|
||||
];
|
||||
component.items = testItems;
|
||||
fixture.detectChanges();
|
||||
const renderedItems = testingUtils.getAllByCSS('.adf-navbar-item-btn').map((item) => item.nativeElement);
|
||||
const navbarItems = testingUtils.getAllByDirective(NavbarItemComponent);
|
||||
testItems.forEach((item, index) => {
|
||||
expect(renderedItems[index].textContent).toContain(item.label);
|
||||
expect(renderedItems[index].getAttribute('ng-reflect-router-link')).toContain(item.routerLink);
|
||||
expect(navbarItems[index].componentInstance.label).toBe(item.label);
|
||||
expect(navbarItems[index].componentInstance.routerLink).toBe(item.routerLink);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -22,6 +22,7 @@ import { HarnessLoader } from '@angular/cdk/testing';
|
||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
import { UnitTestingUtils } from '../../../testing/unit-testing-utils';
|
||||
import { provideRouter } from '@angular/router';
|
||||
import { MatToolbar } from '@angular/material/toolbar';
|
||||
|
||||
describe('HeaderLayoutComponent', () => {
|
||||
let loader: HarnessLoader;
|
||||
@@ -56,13 +57,11 @@ describe('HeaderLayoutComponent', () => {
|
||||
expect(testingUtils.getInnerTextByCSS('.adf-app-title')).toEqual('TEST TITLE');
|
||||
});
|
||||
|
||||
it('color attribute should be present on toolbar', async () => {
|
||||
it('should have assigned correct color on toolbar', async () => {
|
||||
component.color = 'primary';
|
||||
fixture.detectChanges();
|
||||
|
||||
const host = await testingUtils.getMatToolbarHost();
|
||||
|
||||
expect(await host.getAttribute('ng-reflect-color')).toBe('primary');
|
||||
expect(testingUtils.getByDirective(MatToolbar).componentInstance.color).toBe('primary');
|
||||
});
|
||||
|
||||
it('should change background color when custom is provided', async () => {
|
||||
|
||||
@@ -80,6 +80,10 @@ export class UnitTestingUtils {
|
||||
return this.debugElement.query(By.directive(directive));
|
||||
}
|
||||
|
||||
getAllByDirective(directive: Type<any>): DebugElement[] {
|
||||
return this.debugElement.queryAll(By.directive(directive));
|
||||
}
|
||||
|
||||
/** Perform actions */
|
||||
|
||||
clickByCSS(selector: string): void {
|
||||
|
||||
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();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
}
|
||||
|
||||
@for(opt of (list$ | async); track opt.id) {
|
||||
<mat-option [value]="opt" [id]="opt.id">
|
||||
<mat-option [value]="opt" [id]="opt.id" [attr.data-automation-id]="'adf-dropdown-widget-option-' + opt.id">
|
||||
{{opt.name}}
|
||||
</mat-option>
|
||||
}
|
||||
|
||||
@@ -1417,6 +1417,7 @@ describe('DropdownCloudWidgetComponent instantiated by FormFieldComponent wrappe
|
||||
let formFieldComponent: FormFieldComponent;
|
||||
let loader: HarnessLoader;
|
||||
let formRenderingService: FormRenderingService;
|
||||
let unitTestingUtils: UnitTestingUtils;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
@@ -1425,6 +1426,7 @@ describe('DropdownCloudWidgetComponent instantiated by FormFieldComponent wrappe
|
||||
|
||||
formFieldFixture = TestBed.createComponent(FormFieldComponent);
|
||||
formFieldComponent = formFieldFixture.componentInstance;
|
||||
unitTestingUtils = new UnitTestingUtils(formFieldFixture.debugElement);
|
||||
|
||||
loader = TestbedHarnessEnvironment.loader(formFieldFixture);
|
||||
|
||||
@@ -1464,7 +1466,7 @@ describe('DropdownCloudWidgetComponent instantiated by FormFieldComponent wrappe
|
||||
|
||||
// Not using dropdown.clickOptions from harness since it need ot be awaited
|
||||
// I want to simulate other events at the same time
|
||||
const option1 = formFieldFixture.debugElement.query(By.css('[ng-reflect-id="option1"]'));
|
||||
const option1 = unitTestingUtils.getByDataAutomationId('adf-dropdown-widget-option-option1');
|
||||
option1.triggerEventHandler('click');
|
||||
dropdownCloudWidgetInstanceComponent.event(new Event('focusout'));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user