-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Migrate muild-map-data.spec.js
- needs to be run as a component test, as it needs the App context including the store. It is therefore not in the __tests__ folder but on the same level as the script. - added empty, skipped test bodies for missing functions - issue #323 there are currently 2 similar and confusing functions: - buildMapViewData: 'Build and returns map data' - buildMapData: 'Build the mapViewData object' - remove old spec
- Loading branch information
1 parent
e70d02f
commit 3e5161b
Showing
2 changed files
with
54 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import buildMapData from 'fixtures/build-map-data' | ||
import MapViewDataBuilder from './map-view-data-builder' | ||
import MapViewData from '@/models/map-view-data' | ||
|
||
|
||
describe('MapViewData building', () => { | ||
context('buildMapViewData()', () => { | ||
it('builds with directions map data', () => { | ||
return new Promise((resolve, reject) => { | ||
MapViewDataBuilder.buildMapData(buildMapData.directionsMapData, []).then( | ||
response => { | ||
assert.isDefined(response) | ||
expect(response).to.be.instanceOf(MapViewData) | ||
expect(response.routes).to.have.length(1) | ||
expect(response.places).to.have.length(2) | ||
expect(response.mode).to.equal('directions') | ||
resolve() | ||
}).catch(error => { | ||
reject(error) | ||
}) | ||
}) | ||
}) | ||
it('builds with isochrones map data', () => { | ||
return new Promise((resolve, reject) => { | ||
MapViewDataBuilder.buildMapData(buildMapData.isochronesMapData, []).then( | ||
response => { | ||
assert.isDefined(response) | ||
expect(response).to.be.instanceOf(MapViewData) | ||
expect(response.polygons).to.have.length(1) | ||
expect(response.places).to.have.length(1) | ||
expect(response.mode).to.equal('isochrones') | ||
resolve() | ||
}).catch(error => { | ||
reject(error) | ||
}) | ||
}) | ||
}) | ||
}) | ||
context.skip('getSourceType()', () => { | ||
it.skip('gets the source type', () => { | ||
// TODO | ||
}) | ||
}) | ||
context.skip('setMapExtractorBuilder()', () => { | ||
it.skip('sets the map data builder', () => { | ||
// TODO | ||
}) | ||
}) | ||
context.skip('buildMapData()', () => { | ||
it.skip('builds the map data', () => { | ||
// TODO | ||
}) | ||
}) | ||
}) |
This file was deleted.
Oops, something went wrong.