Added tests for the version component.

This commit is contained in:
Manuel Friedli 2018-09-01 01:07:03 +02:00
parent 31c60f12a7
commit a0590cc0db

View file

@ -1,6 +1,7 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
import { VersionComponent } from './version.component';
import {VersionComponent} from './version.component';
import {environment} from '../../environments/environment';
describe('VersionComponent', () => {
let component: VersionComponent;
@ -8,7 +9,7 @@ describe('VersionComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ VersionComponent ]
declarations: [VersionComponent]
})
.compileComponents();
}));
@ -22,4 +23,14 @@ describe('VersionComponent', () => {
it('should create', () => {
expect(component).toBeTruthy();
});
it('should contain the correct version', () => {
// when executing the test, we're always running with the dev environment
expect(component.VERSION).toEqual(`${environment.appVersion} (development build)`);
});
it('should have the correct value for the "production" property', () => {
// when executing the test, we're always running with the dev environment
expect(component.PROD).toBeFalsy();
});
});