Closed prabhat112 closed 5 years ago
VS code version:1.31.1 SimonTest:1.1.0 Angular:6.0.3
Getting error when I run the generate tests command
//Below Component TS
import { Component, OnInit, OnDestroy, ChangeDetectionStrategy, AfterContentChecked } from '@angular/core'; import { Observable } from 'rxjs'; import { Store, select } from '@ngrx/store'; import { AppState } from 'app/core/store'; import * as fromStore from 'app/core/store'; import { Entitlements } from 'app/core/model/entitlements'; import { MasterUserList, IRUserList, FXUserList } from 'app/shared/constants/constants';
@Component({ selector: 'fph-dashboard', templateUrl: './dashboard.component.html', styleUrls: ['./dashboard.component.css'], changeDetection: ChangeDetectionStrategy.OnPush }) export class DashboardComponent implements OnInit, OnDestroy, AfterContentChecked { paymentQueueCount$: Observable; exceptionQueueCount$: Observable; inprocessQueueCount$: Observable; processedQueueCount$: Observable; ofacQueueCount$: Observable; investigationQueueCount$: Observable; remittanceQueueCount$: Observable; MasterUserList = MasterUserList; IRUserList = IRUserList; FXUserList = FXUserList; currentUser: Entitlements; dashboardQueueTile: boolean[] = [ false, false, false, false, false, false, false, false ]; // [PayQ, ExcQ, InpQ, ProcQ, OfacQ, InvQ, IRQ]
constructor(private store: Store) {} ngOnInit() { }
ngAfterContentChecked() { this.currentUser = JSON.parse(localStorage.getItem('currentUser')); this.displayDashboardTiles(); this.getWebsocketCounts(); } getWebsocketCounts() { this.paymentQueueCount$ = this.store.pipe( select(fromStore.getPaymentQueueCount$) ); this.exceptionQueueCount$ = this.store.pipe( select(fromStore.getExceptionQueueCount$) ); this.inprocessQueueCount$ = this.store.pipe( select(fromStore.getInprocessQueueCount$) ); this.processedQueueCount$ = this.store.pipe( select(fromStore.getProcessedQueueCount$) ); this.ofacQueueCount$ = this.store.pipe( select(fromStore.getOfacQueueCount$) ); this.investigationQueueCount$ = this.store.pipe( select(fromStore.getInvestigationQueueCount$) ); this.remittanceQueueCount$ = this.store.pipe( select(fromStore.getRemittanceQueueCount$) ); } ngOnDestroy() {} displayDashboardTiles() { if (this.FXUserList.includes(this.currentUser.roleConstant)) { this.dashboardQueueTile = [ false, true, true, true, true, true, true, false ]; // [IRQ, PayQ, ExcQ, InpQ, ProcQ, OfacQ, InvQ, IRQ] } else if (this.IRUserList.includes(this.currentUser.roleConstant)) { this.dashboardQueueTile = [ true, false, true, true, true, true, false, false ]; } else if (this.MasterUserList.includes(this.currentUser.roleConstant)) { this.dashboardQueueTile = [ false, true, true, true, true, true, true, true ]; } } }
Thx for reporting it. Pick up v1.1.1
Thanks. That worked!
VS code version:1.31.1 SimonTest:1.1.0 Angular:6.0.3
Getting error when I run the generate tests command
//Below Component TS
import { Component, OnInit, OnDestroy, ChangeDetectionStrategy, AfterContentChecked } from '@angular/core'; import { Observable } from 'rxjs'; import { Store, select } from '@ngrx/store'; import { AppState } from 'app/core/store'; import * as fromStore from 'app/core/store'; import { Entitlements } from 'app/core/model/entitlements'; import { MasterUserList, IRUserList, FXUserList } from 'app/shared/constants/constants';
@Component({ selector: 'fph-dashboard', templateUrl: './dashboard.component.html', styleUrls: ['./dashboard.component.css'], changeDetection: ChangeDetectionStrategy.OnPush }) export class DashboardComponent implements OnInit, OnDestroy, AfterContentChecked { paymentQueueCount$: Observable;
exceptionQueueCount$: Observable;
inprocessQueueCount$: Observable;
processedQueueCount$: Observable;
ofacQueueCount$: Observable;
investigationQueueCount$: Observable;
remittanceQueueCount$: Observable;
MasterUserList = MasterUserList;
IRUserList = IRUserList;
FXUserList = FXUserList;
currentUser: Entitlements;
dashboardQueueTile: boolean[] = [
false,
false,
false,
false,
false,
false,
false,
false
]; // [PayQ, ExcQ, InpQ, ProcQ, OfacQ, InvQ, IRQ]
constructor(private store: Store) {}
ngOnInit() {
}
ngAfterContentChecked() { this.currentUser = JSON.parse(localStorage.getItem('currentUser')); this.displayDashboardTiles(); this.getWebsocketCounts(); } getWebsocketCounts() { this.paymentQueueCount$ = this.store.pipe( select(fromStore.getPaymentQueueCount$) ); this.exceptionQueueCount$ = this.store.pipe( select(fromStore.getExceptionQueueCount$) ); this.inprocessQueueCount$ = this.store.pipe( select(fromStore.getInprocessQueueCount$) ); this.processedQueueCount$ = this.store.pipe( select(fromStore.getProcessedQueueCount$) ); this.ofacQueueCount$ = this.store.pipe( select(fromStore.getOfacQueueCount$) ); this.investigationQueueCount$ = this.store.pipe( select(fromStore.getInvestigationQueueCount$) ); this.remittanceQueueCount$ = this.store.pipe( select(fromStore.getRemittanceQueueCount$) ); } ngOnDestroy() {} displayDashboardTiles() { if (this.FXUserList.includes(this.currentUser.roleConstant)) { this.dashboardQueueTile = [ false, true, true, true, true, true, true, false ]; // [IRQ, PayQ, ExcQ, InpQ, ProcQ, OfacQ, InvQ, IRQ] } else if (this.IRUserList.includes(this.currentUser.roleConstant)) { this.dashboardQueueTile = [ true, false, true, true, true, true, false, false ]; } else if (this.MasterUserList.includes(this.currentUser.roleConstant)) { this.dashboardQueueTile = [ false, true, true, true, true, true, true, true ]; } } }