Testing Nebular auth inherited component
- 主要语言
- TypeScript
- 星标
- 8.1k
- 派生
- 1.5k
- PR 合并指标
- 30 天内没有已合并 PR
描述
I'm using Nebular (akveo/nebular) Authmodule in my project and it's working fine, but when I wanted to test my components that are extended from Nebular components I got this error :
`TypeError: There is no Auth Strategy registered under 'email' name
`
here and example of my test class
```
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { LogoutComponent } from './logout.component';
import { NbAuthModule } from '@nebular/auth';
import { RouterTestingModule } from '@angular/router/testing';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { CommonModule } from '@angular/common';
describe('LogoutComponent', () => {
let component: LogoutComponent;
let fixture: ComponentFixture;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [LogoutComponent],
imports: [
FormsModule,
ReactiveFormsModule,
CommonModule,
NbAuthModule.forRoot(),
RouterTestingModule,
],
}).compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(LogoutComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
```
I tried to passe the stratergy in the module declaration like this
```
.....
NbAuthModule.forRoot({
strategies: [
NbPasswordAuthStrategy.setup({
name: 'email',
}),
],
}),
.....
```
But I got an other error :(.
贡献指南
评估
这个 Issue 还没有评估数据。