I'm currently working on my first "rl project" for a company (for my diploma thesis) and I started testing our Angular 5 application and I ran into some questions. The auto generated tests which Angular writes for you all failed, and after working on it I came to the point where I thought that I need to import all dependencies from app.module.ts into admin.component.spec.ts for it to work. Now, it kinda worked (it did with other classes) but this just feels wrong. I'm at a point where I don't believe that this you're supposed to write tests like this, and I can't really find any information on the internet about this. That is my first question, but now to my second one: My described method didn't work with ngrx/store. In my app.module.ts I did
import { StoreModule } from '@ngrx/store';
and
@NgModule({
imports: [
StoreModule.forRoot({}),
...
]
...
})
But whatever I do in app.component.spec.ts, tests will always throw
Failed: StaticInjectorError(DynamicTestModule)[LayoutStateStore -> Store]:
StaticInjectorError(Platform: core)[LayoutStateStore -> Store]:
NullInjectorError: No provider for Store!
I hope you understand my problems and can help me.