У меня есть компонент с селектором сущностей 'selectAllProperties' в ngOnInit, и я хочу протестировать этот компонент:
ngOnInit() {
this.store.dispatch(new LoadPropertiesRequested());
this.properties$ = this.store.pipe(select(selectAllProperties));
this.loading$ = this.store.pipe(select(selectPropertiesLoading));
this.logs$ = this.store.pipe(select(selectPropertiesLogs));
}
В моем spec-файле я инициализировал хранилище, как в документе ngrx:
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
StoreModule.forRoot({
...fromRoot.reducers,
feature: combineReducers(fromProperties.reducer),
})
],
declarations: [
SidebarPropertiesComponent,
SidebarElementComponent
]
})
.compileComponents();
}));
Когда я запускаю тесты, у меня появляется «TypeError: Невозможно прочитать свойства« идентификаторы неопределенных ».Все остальные селекторы не выдают ошибок
Я также хотел бы посмеяться над Observable, возвращаемым каждым селектором.
Спасибо