Skip to content
Snippets Groups Projects
Commit cbe71d5d authored by Marc Hanisch's avatar Marc Hanisch
Browse files

removes type property from Location

parent edfd6d7f
No related branches found
No related tags found
1 merge request!33Feature configuration models
import { DeviceProperty } from '@/models/DeviceProperty'
export interface IStationaryLocation {
type: string
latitude: number | null
longitude: number | null
elevation: number | null
......@@ -12,10 +11,6 @@ export class StationaryLocation implements IStationaryLocation {
private _longitude: number | null = null
private _elevation: number | null = null
get type (): string {
return 'stationary'
}
get latitude (): number | null {
return this._latitude
}
......@@ -50,7 +45,6 @@ export class StationaryLocation implements IStationaryLocation {
}
export interface IDynamicLocation {
type: string
latitude: DeviceProperty | null
longitude: DeviceProperty | null
elevation: DeviceProperty | null
......@@ -61,10 +55,6 @@ export class DynamicLocation implements IDynamicLocation {
private _longitude: DeviceProperty | null = null
private _elevation: DeviceProperty | null = null
get type (): string {
return 'dynamic'
}
get latitude (): DeviceProperty | null {
return this._latitude
}
......
......@@ -3,9 +3,8 @@ import { DeviceProperty } from '@/models/DeviceProperty'
describe('StationaryLocation', () => {
it('should create a StationaryLocation from an object', () => {
const location = StationaryLocation.createFromObject({ type: 'stationary', latitude: 50.986451, longitude: 12.973538, elevation: 280 })
const location = StationaryLocation.createFromObject({ latitude: 50.986451, longitude: 12.973538, elevation: 280 })
expect(typeof location).toBe('object')
expect(location).toHaveProperty('type', 'stationary')
expect(location).toHaveProperty('latitude', 50.986451)
expect(location).toHaveProperty('longitude', 12.973538)
expect(location).toHaveProperty('elevation', 280)
......@@ -18,9 +17,8 @@ describe('DynamicLocation', () => {
const longitude = new DeviceProperty()
const elevation = new DeviceProperty()
const location = DynamicLocation.createFromObject({ type: 'dynamic', latitude, longitude, elevation })
const location = DynamicLocation.createFromObject({ latitude, longitude, elevation })
expect(typeof location).toBe('object')
expect(location).toHaveProperty('type', 'dynamic')
expect(location).toHaveProperty('latitude', latitude)
expect(location).toHaveProperty('longitude', longitude)
expect(location).toHaveProperty('elevation', elevation)
......
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