Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Error: Error in ./ReturnFileParameterComponent class ReturnFileParameterComponent - inline template:2:4 caused by: undefined is not a constructor (evaluating 'this.documentResponsiveListener()') in C:/Users/wlaw/Desktop/ens_fits_ui/karma-shim.js (line 41475)
- ngOnDestroy@C:/Users/wlaw/Desktop/ens_fits_ui/karma-shim.js:71991:45 <- webpack:///~/primeng/components/confirmdialog/confirmdialog.js:140:0
- ngOnDestroy
- destroyInternal
- destroy@C:/Users/wlaw/Desktop/ens_fits_ui/karma-shim.js:41076:34 <- webpack:///~/@angular/core/bundles/core.umd.js:12361:0
- ...
- import {
- ...
- ConfirmDialogModule,
- ConfirmationService
- } from 'primeng/primeng';
- describe('Return File Parameter Component Test', () => {
- beforeEach(() => {
- TestBed.configureTestingModule({
- declarations: [ReturnFileParameterComponent, HtmlUserFriendlyTimePipe, Html24HourDatePipe, DayOfWeekPipe],
- providers: [
- ...
- ConfirmationService,
- ...
- ],
- imports: [
- ...
- ConfirmDialogModule
- ]
- });
- TestBed.compileComponents();
- });
- ...
- it('should call add on a new Return File Parameter and submit it to the service', inject(
- [ReturnFileParameterComponent, AuthHelper],
- (component: ReturnFileParameterComponent, authHelper: AuthHelper) => {
- let fixture: ComponentFixture<ReturnFileParameterComponent> =
- getTestBed().createComponent(ReturnFileParameterComponent);
- fixture.componentInstance.ngOnInit()
- .then(fixture.detectChanges)
- .then(function () {
- let newParam = fixture.componentInstance.add();
- expect(fixture.componentInstance.selectedParam).toBe(newParam);
- expect(fixture.componentInstance.editParam).toBe(true);
- });
- })
- );
- });
- <div class="ui-grid-row" id="return-parameter-table">
- <h5>Return File Parameters</h5>
- <p-growl [value]="msgs" life="3000"></p-growl>
- <p-confirmDialog header="Confirmation" icon="fa fa-question-circle" width="425"></p-confirmDialog>
- ...
- // Fake component class because the ConfirmDialog has issues with Karma/Jasmine
- @Component({
- selector: 'p-confirmDialog',
- template: ''
- })
- class FakeConfirmDialogComponent {
- }
- describe('Return File Parameter Component Test', () => {
- beforeEach(() => {
- TestBed.configureTestingModule({
- declarations: [ReturnFileParameterComponent, HtmlUserFriendlyTimePipe, Html24HourDatePipe, DayOfWeekPipe],
- providers: [
- ...
- ConfirmationService,
- ...
- ],
- imports: [
- ConfirmDialogModule,
- ...
- ]
- });
- TestBed.overrideModule(ConfirmDialogModule, {
- set: {
- declarations: [FakeConfirmDialogComponent],
- exports: [FakeConfirmDialogComponent]
- }
- })
- TestBed.compileComponents();
- });
- // All my tests here
- });
- import { async, ComponentFixture, TestBed } from '@angular/core/testing'
- import { CITComponent } from './cit.component'
- import { ReactiveFormsModule } from '@angular/forms'
- import { TooltipModule } from 'primeng/tooltip'
- import { ConfirmDialogModule } from 'primeng/confirmdialog'
- import { NotificationService } from 'src/app/services/notification/notification.service'
- import { Router } from '@angular/router'
- import { EvaluationService } from 'src/app/services/api/evaluation.service'
- import { ConfirmationService } from 'primeng/api'
- import { Component } from '@angular/core'
- // Fake component class because the ConfirmDialog has issues with Karma/Jasmine
- @Component({
- selector: 'p-confirmDialog',
- template: ''
- })
- class FakeConfirmDialogComponent {}
- describe('CITComponent', () => {
- let component: CITComponent
- let fixture: ComponentFixture<CITComponent>
- beforeEach(async(() => {
- const notificationService = jasmine.createSpyObj('NotificationService', ['success', 'warning', 'error'])
- const router = jasmine.createSpyObj('Router', ['navigateByUrl'])
- const evaluationService = jasmine.createSpyObj('EvaluationService', ['postIndicators'])
- TestBed.configureTestingModule({
- declarations: [ CITComponent ],
- imports: [ ReactiveFormsModule, TooltipModule, ConfirmDialogModule ],
- providers: [
- { provide: NotificationService, useValue: notificationService },
- { provide: Router, useValue: router },
- { provide: EvaluationService, useValue: evaluationService },
- ConfirmationService
- ]
- })
- .overrideModule(ConfirmDialogModule, {
- set: {
- declarations: [FakeConfirmDialogComponent],
- exports: [FakeConfirmDialogComponent]
- }
- })
- .compileComponents()
- }))
- beforeEach(() => {
- fixture = TestBed.createComponent(CITComponent)
- component = fixture.componentInstance
- fixture.detectChanges()
- })
- it('should create', () => {
- expect(component).toBeTruthy()
- })
- })
- C:entornosremourbanOworkspacesyoopi-front>ng test
- 10% building modules 2/2 modules 0 active23 01 2019 18:04:32.302:INFO [karma]: Karma v3.0.0 server started at http://0.0.0.0:9876/
- 23 01 2019 18:04:32.305:INFO [launcher]: Launching browser ChromeHeadlessCI with unlimited concurrency
- 23 01 2019 18:04:32.311:INFO [launcher]: Starting browser ChromeHeadless 23 01 2019 18:04:38.644:INFO [HeadlessChrome 0.0.0 (Windows 10 0.0.0)]: Connected on socket XsIYJzf_FRJMkn1bAAAA with id 11316169
- HeadlessChrome 0.0.0 (Windows 10 0.0.0) ERROR: 'DEPRECATION: fit and fdescribe will cause your suite to report an 'incomplete' status in Jasmine 3.0'
- HeadlessChrome 0.0.0 (Windows 10 0.0.0) ERROR: 'DEPRECATION: fit and fdescribe will cause your suite to report an 'incomplete' status in Jasmine 3.0'
- HeadlessChrome 0.0.0 (Windows 10 0.0.0) ERROR: 'DEPRECATION: fit and fdescribe will cause your suite to report an 'incomplete' status in Jasmine 3.0'
- HeadlessChrome 0.0.0 (Windows 10 0.0.0) ERROR: 'DEPRECATION: fit and fdescribe will cause your suite to report an 'incomplete' status in Jasmine 3.0'
- HeadlessChrome 0.0.0 (Windows 10 0.0.0) EvaluationsComponent should create FAILED
- TypeError: Cannot read property 'subscribe' of undefined
- at new ConfirmDialog (http://localhost:9876/node_modules/primeng/components/confirmdialog/confirmdialog.js?:39:1)
- at createClass (http://localhost:9876/node_modules/@angular/core/fesm5/core.js?:18598:1)
- at createDirectiveInstance (http://localhost:9876/node_modules/@angular/core/fesm5/core.js?:18467:1)
- at createViewNodes (http://localhost:9876/node_modules/@angular/core/fesm5/core.js?:19693:1)
- at callViewAction (http://localhost:9876/node_modules/@angular/core/fesm5/core.js?:20009:1)
- at execComponentViewsAction (http://localhost:9876/node_modules/@angular/core/fesm5/core.js?:19928:1)
- at createViewNodes (http://localhost:9876/node_modules/@angular/core/fesm5/core.js?:19721:1)
- at createRootView (http://localhost:9876/node_modules/@angular/core/fesm5/core.js?:19607:1)
- at callWithDebugContext (http://localhost:9876/node_modules/@angular/core/fesm5/core.js?:20639:1)
- at Object.debugCreateRootView [as createRootView] (http://localhost:9876/node_modules/@angular/core/fesm5/core.js?:20125:1)
- Expected undefined to be truthy.
- at UserContext.<anonymous> (http://localhost:9876/src/app/components/evaluations/evaluations.component.spec.ts?:45:23)
- at ZoneDelegate../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (http://localhost:9876/node_modules/zone.js/dist/zone.js?:388:1)
- at ProxyZoneSpec.push../node_modules/zone.js/dist/zone-testing.js.ProxyZoneSpec.onInvoke (http://localhost:9876/node_modules/zone.js/dist/zone-testing.js?:288:1)
- at ZoneDelegate../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (http://localhost:9876/node_modules/zone.js/dist/zone.js?:387:1)
- HeadlessChrome 0.0.0 (Windows 10 0.0.0): Executed 1 of 22 (1 FAILED) (0 secs / 0.48 secs)
Add Comment
Please, Sign In to add comment