mirror of
https://github.com/sartography/uva-covid19-testing-frontend.git
synced 2025-02-11 23:26:58 +00:00
Stubs out some tests
This commit is contained in:
parent
1a7c551dfa
commit
4ea2109cd8
@ -1,19 +1,35 @@
|
|||||||
|
import {APP_BASE_HREF} from '@angular/common';
|
||||||
|
import {HttpClientTestingModule, HttpTestingController} from '@angular/common/http/testing';
|
||||||
import {async, ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing';
|
import {async, ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing';
|
||||||
|
import {ApiService} from '../services/api.service';
|
||||||
|
import {CacheService} from '../services/cache.service';
|
||||||
|
import {MockEnvironment} from '../testing/environment.mock';
|
||||||
|
|
||||||
import { HomeComponent } from './home.component';
|
import { HomeComponent } from './home.component';
|
||||||
|
|
||||||
describe('HomeComponent', () => {
|
describe('HomeComponent', () => {
|
||||||
let component: HomeComponent;
|
let component: HomeComponent;
|
||||||
let fixture: ComponentFixture<HomeComponent>;
|
let fixture: ComponentFixture<HomeComponent>;
|
||||||
|
let httpMock: HttpTestingController;
|
||||||
|
|
||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
declarations: [ HomeComponent ]
|
declarations: [ HomeComponent ],
|
||||||
|
imports: [
|
||||||
|
HttpClientTestingModule,
|
||||||
|
],
|
||||||
|
providers: [
|
||||||
|
ApiService,
|
||||||
|
CacheService,
|
||||||
|
{provide: 'APP_ENVIRONMENT', useClass: MockEnvironment},
|
||||||
|
{provide: APP_BASE_HREF, useValue: '/'},
|
||||||
|
],
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
httpMock = TestBed.inject(HttpTestingController);
|
||||||
fixture = TestBed.createComponent(HomeComponent);
|
fixture = TestBed.createComponent(HomeComponent);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
|
20
src/app/services/cache.service.spec.ts
Normal file
20
src/app/services/cache.service.spec.ts
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import {TestBed} from '@angular/core/testing';
|
||||||
|
import {CacheService} from './cache.service';
|
||||||
|
|
||||||
|
describe('CacheService', () => {
|
||||||
|
let service: CacheService;
|
||||||
|
|
||||||
|
beforeEach(() => TestBed.configureTestingModule({
|
||||||
|
providers: [
|
||||||
|
CacheService,
|
||||||
|
],
|
||||||
|
}));
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
service = TestBed.inject(CacheService);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should be created', () => {
|
||||||
|
expect(service).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
20
src/app/services/settings.service.spec.ts
Normal file
20
src/app/services/settings.service.spec.ts
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import {TestBed} from '@angular/core/testing';
|
||||||
|
import {SettingsService} from './settings.service';
|
||||||
|
|
||||||
|
describe('SettingsService', () => {
|
||||||
|
let service: SettingsService;
|
||||||
|
|
||||||
|
beforeEach(() => TestBed.configureTestingModule({
|
||||||
|
providers: [
|
||||||
|
SettingsService,
|
||||||
|
],
|
||||||
|
}));
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
service = TestBed.inject(SettingsService);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should be created', () => {
|
||||||
|
expect(service).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
Loading…
x
Reference in New Issue
Block a user