diff --git a/test/unit/specs/module.spec.js b/test/unit/specs/module.spec.js index 89777043..efaf1eac 100644 --- a/test/unit/specs/module.spec.js +++ b/test/unit/specs/module.spec.js @@ -84,25 +84,39 @@ describe('ti.map', () => { } if (ANDROID) { - describe('SERVICE_*', () => { - it('SERVICE_DISABLED', () => { - expect(Map.SERVICE_DISABLED).toEqual(jasmine.any(Number)); + describe('TILE_OVERLAY_TYPE_*', () => { + it('TILE_OVERLAY_TYPE_WMS', () => { + expect(Map.TILE_OVERLAY_TYPE_WMS).toEqual(jasmine.any(Number)); }); - it('SERVICE_INVALID', () => { - expect(Map.SERVICE_INVALID).toEqual(jasmine.any(Number)); + it('TILE_OVERLAY_TYPE_WMTS', () => { + expect(Map.TILE_OVERLAY_TYPE_WMTS).toEqual(jasmine.any(Number)); }); - it('SERVICE_MISSING', () => { - expect(Map.SERVICE_MISSING).toEqual(jasmine.any(Number)); + it('TILE_OVERLAY_TYPE_BING', () => { + expect(Map.TILE_OVERLAY_TYPE_BING).toEqual(jasmine.any(Number)); }); - it('SERVICE_VERSION_UPDATE_REQUIRED', () => { - expect(Map.SERVICE_VERSION_UPDATE_REQUIRED).toEqual(jasmine.any(Number)); + it('TILE_OVERLAY_TYPE_CARTODB', () => { + expect(Map.TILE_OVERLAY_TYPE_CARTODB).toEqual(jasmine.any(Number)); }); - it('SUCCESS', () => { - expect(Map.SUCCESS).toEqual(jasmine.any(Number)); + it('TILE_OVERLAY_TYPE_XYZ', () => { + expect(Map.TILE_OVERLAY_TYPE_XYZ).toEqual(jasmine.any(Number)); + }); + + it('TILE_OVERLAY_TYPE_OSM', () => { + expect(Map.TILE_OVERLAY_TYPE_OSM).toEqual(jasmine.any(Number)); + }); + }); + + describe('ANNOTATION_DRAG_STATE_*', () => { + it('ANNOTATION_DRAG_STATE_END', () => { + expect(Map.ANNOTATION_DRAG_STATE_END).toEqual(jasmine.any(Number)); + }); + + it('ANNOTATION_DRAG_STATE_START', () => { + expect(Map.ANNOTATION_DRAG_STATE_START).toEqual(jasmine.any(Number)); }); }); } diff --git a/test/unit/specs/tileoverlay.spec.js b/test/unit/specs/tileoverlay.spec.js new file mode 100644 index 00000000..31340f18 --- /dev/null +++ b/test/unit/specs/tileoverlay.spec.js @@ -0,0 +1,35 @@ +const Map = require('ti.map'); +const ANDROID = (Ti.Platform.osname === 'android'); + +if (ANDROID) { + describe('ti.map', () => { + describe('#createTileOverlay()', () => { + it('is a Function', () => { + expect(Map.createTileOverlay).toEqual(jasmine.any(Function)); + }); + }); + }); + + describe('ti.map.TileOverlay', () => { + let overlay; + beforeAll(() => { + overlay = Map.createTileOverlay({ + service: Map.TILE_OVERLAY_TYPE_XYZ, + url: 'http://stamen-tiles-a.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.png' + }); + }); + + it('.apiName', () => { + expect(overlay.apiName).toEqual('Ti.Map.TileOverlay'); + }); + + it('.service should match given constant', () => { + expect(overlay.service).toEqual(Map.TILE_OVERLAY_TYPE_XYZ); + }); + + it('.url should match given String', () => { + expect(overlay.url).toEqual('http://stamen-tiles-a.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.png'); + }); + + }); +} diff --git a/test/unit/specs/view.spec.js b/test/unit/specs/view.spec.js index cce92311..d7d572d6 100644 --- a/test/unit/specs/view.spec.js +++ b/test/unit/specs/view.spec.js @@ -112,6 +112,17 @@ describe('ti.map.View', () => { }); } + if (ANDROID) { + // TODO: Add to iOS for parity + it('#addTileOverlay() is a Function', () => { + expect(mapview.addTileOverlay).toEqual(jasmine.any(Function)); + }); + + it('#removeTileOverlay() is a Function', () => { + expect(mapview.removeTileOverlay).toEqual(jasmine.any(Function)); + }); + } + it('#deselectAnnotation() is a Function', () => { expect(mapview.deselectAnnotation).toEqual(jasmine.any(Function)); });