mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 09:12:52 +00:00
35 lines
971 B
JavaScript
35 lines
971 B
JavaScript
describe('Map', function() {
|
|
var node, foo;
|
|
|
|
beforeEach(function() {
|
|
foo = document.body.appendChild(document.createElement('div'));
|
|
foo.id = 'foo';
|
|
map = iD.Map({
|
|
selector: '#foo',
|
|
connection: iD.Connection()
|
|
});
|
|
});
|
|
|
|
afterEach(function() {
|
|
foo.parentNode.removeChild(foo);
|
|
});
|
|
|
|
describe('#getZoom', function() {
|
|
it('accurate reports zoom level', function() {
|
|
expect(map.setZoom(4)).toEqual(map);
|
|
expect(map.getZoom()).toEqual(4);
|
|
});
|
|
});
|
|
|
|
describe('#zoomIn', function() {
|
|
it('changes reported zoom level', function() {
|
|
expect(map.setZoom(4)).toEqual(map);
|
|
expect(map.getZoom()).toEqual(4);
|
|
expect(map.zoomOut()).toEqual(map);
|
|
expect(map.getZoom()).toEqual(3);
|
|
expect(map.zoomIn()).toEqual(map);
|
|
expect(map.getZoom()).toEqual(4);
|
|
});
|
|
});
|
|
});
|