feat: fix api spec errors
This commit is contained in:
@@ -12,32 +12,36 @@ import { mockProvider } from './testing/mock';
|
||||
|
||||
describe('AuthModule', () => {
|
||||
describe('APP_CONFIG', () => {
|
||||
let authModule: AuthModule;
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [AuthModule.forRoot({ config: { authority: 'something' } })],
|
||||
providers: [mockProvider(ConfigurationService)],
|
||||
}).compileComponents();
|
||||
authModule = TestBed.getImportByType(AuthModule);
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(AuthModule).toBeDefined();
|
||||
expect(new AuthModule()).toBeDefined();
|
||||
expect(authModule).toBeDefined();
|
||||
});
|
||||
|
||||
it('should provide config', () => {
|
||||
const config = TestBed.inject(PASSED_CONFIG);
|
||||
const config = authModule.get(PASSED_CONFIG);
|
||||
|
||||
expect(config).toEqual({ config: { authority: 'something' } });
|
||||
});
|
||||
|
||||
it('should create StsConfigStaticLoader if config is passed', () => {
|
||||
const configLoader = TestBed.inject(StsConfigLoader);
|
||||
const configLoader = authModule.get(StsConfigLoader);
|
||||
|
||||
expect(configLoader instanceof StsConfigStaticLoader).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe('StsConfigHttpLoader', () => {
|
||||
let authModule: AuthModule;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [
|
||||
@@ -50,10 +54,11 @@ describe('AuthModule', () => {
|
||||
],
|
||||
providers: [mockProvider(ConfigurationService)],
|
||||
}).compileComponents();
|
||||
authModule = TestBed.getImportByType(AuthModule);
|
||||
});
|
||||
|
||||
it('should create StsConfigStaticLoader if config is passed', () => {
|
||||
const configLoader = TestBed.inject(StsConfigLoader);
|
||||
const configLoader = authModule.get(StsConfigLoader);
|
||||
|
||||
expect(configLoader instanceof StsConfigHttpLoader).toBe(true);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user