Refs #367 crear test unitarios login
parent
27e55816bd
commit
e00c2347a6
|
@ -19,7 +19,7 @@ import { CustomInterceptor } from './services/custom.interceptor';
|
|||
HeaderComponent,
|
||||
SidebarComponent,
|
||||
LoginComponent,
|
||||
MainLayoutComponent,
|
||||
MainLayoutComponent
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { LoginComponent } from './login.component';
|
||||
import { HttpClientModule } from '@angular/common/http';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
describe('LoginComponent', () => {
|
||||
let component: LoginComponent;
|
||||
|
@ -8,7 +10,8 @@ describe('LoginComponent', () => {
|
|||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [LoginComponent]
|
||||
imports: [HttpClientModule, FormsModule],
|
||||
declarations: [LoginComponent]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
|
|
|
@ -1,17 +1,8 @@
|
|||
import { TestBed } from '@angular/core/testing';
|
||||
import { HttpInterceptorFn } from '@angular/common/http';
|
||||
|
||||
import { customInterceptor } from './custom.interceptor';
|
||||
import { CustomInterceptor } from './custom.interceptor';
|
||||
|
||||
describe('customInterceptor', () => {
|
||||
const interceptor: HttpInterceptorFn = (req, next) =>
|
||||
TestBed.runInInjectionContext(() => customInterceptor(req, next));
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(interceptor).toBeTruthy();
|
||||
});
|
||||
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue