diff --git a/projects/player/src/app/components/elements/external-app-group-element/external-app-group-element.component.spec.ts b/projects/player/src/app/components/elements/external-app-group-element/external-app-group-element.component.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..1666ead7cfd02824058c7d4b1d042178a1d1fdc9 --- /dev/null +++ b/projects/player/src/app/components/elements/external-app-group-element/external-app-group-element.component.spec.ts @@ -0,0 +1,50 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { Component, Input } from '@angular/core'; +import { CastPipe } from 'player/src/app/pipes/cast.pipe'; +import { UnitStateService } from 'player/src/app/services/unit-state.service'; +import { + ExternalAppGroupElementComponent +} from 'player/src/app/components/elements/external-app-group-element/external-app-group-element.component'; +import { GeometryElement } from 'common/models/elements/geometry/geometry'; + +describe('ExternalAppGroupElementComponent', () => { + let component: ExternalAppGroupElementComponent; + let fixture: ComponentFixture<ExternalAppGroupElementComponent>; + let mockUnitStateService: UnitStateService; + + @Component({ selector: 'aspect-geometry', template: '' }) + class GeometryStubComponent { + @Input() elementModel!: GeometryElement; + } + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ + ExternalAppGroupElementComponent, + GeometryStubComponent, + CastPipe + ] + }) + .compileComponents(); + }); + + beforeEach(() => { + mockUnitStateService = TestBed.inject(UnitStateService); + fixture = TestBed.createComponent(ExternalAppGroupElementComponent); + spyOn(mockUnitStateService, 'registerElement'); + spyOn(mockUnitStateService, 'getElementCodeById').withArgs('test').and + .returnValue({ id: 'test', status: 'NOT_REACHED', value: 0 }); + component = fixture.componentInstance; + component.elementModel = new GeometryElement({ + type: 'geometry', + id: 'test', + width: 0, + height: 0 + }); + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +});