Skip to content
Snippets Groups Projects
Commit 1ee3c67e authored by Erik Kimmel's avatar Erik Kimmel
Browse files

test: properly initialize unit tests for the map component. Fix GNP-5433.

parent 41828350
No related branches found
No related tags found
1 merge request!6Create site card. Fix GNP-5433.
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { MapComponent } from './map.component';
import { SiteModel } from '../models/site.model';
describe('MapComponent', () => {
let component: MapComponent;
let fixture: ComponentFixture<MapComponent>;
let component: MapComponent;
let fixture: ComponentFixture<MapComponent>;
const site: SiteModel = {
result: {
locationDbId: 1,
latitude: 1,
longitude: 1,
altitude: 1,
institutionName: '',
institutionAdress: '',
countryName: '',
countryCode: '',
locationType: '',
abbreviation: '',
name: 'site1',
additionalInfo: {
Topography: '',
Slope: '',
Comment: '',
Exposure: '',
'Coordinates precision': '',
'Direction from city': '',
'Distance to city': '',
'Environment type': '',
'Geographical location': '',
'Site status': ''
}
}
};
const sites: Array<SiteModel> = new Array<SiteModel>();
sites.push(site);
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ MapComponent ]
})
.compileComponents();
}));
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [MapComponent]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(MapComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
beforeEach(() => {
fixture = TestBed.createComponent(MapComponent);
component = fixture.componentInstance;
});
it('should create', () => {
expect(component).toBeTruthy();
});
it('should create', () => {
component.sites = sites;
fixture.detectChanges();
expect(component).toBeTruthy();
});
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment