Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.

Commit

Permalink
fix path(s) support in "fit" + tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jbdemonte committed Jan 31, 2016
1 parent bce96b9 commit 0fa3316
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
29 changes: 27 additions & 2 deletions tests/moke.google.maps.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,37 @@ window.google = (function () {

maps.Polyline = createGenericObject({
prop: 'draggable editable map path visible options',
constructor: true
constructor: function (options) {
var self = this;
$.extend(self.__data, options);
this.getPath = function () {
return {
getArray: function () {
return (self.__data.path || []).slice();
}
}
};
}
});

maps.Polygon = createGenericObject({
prop: 'draggable editable map path paths visible options',
constructor: true
constructor: function (options) {
var self = this;
$.extend(self.__data, options);
// simulate only one path
this.getPaths = function () {
return {
getArray: function () {
return [{
getArray: function () {
return (self.__data.paths || []).slice()
}
}]
}
}
};
}
});

maps.InfoWindow.prototype.open = function (map, anchor) {
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/fit.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('fit', function () {
self.handler = this.$element.gmap3({center: [1, 2]});
});

it('should return the differents object in the good order', function (done) {
it('should handle all latLng', function (done) {

this.handler
.marker({position: [3, 4]})
Expand Down

0 comments on commit 0fa3316

Please sign in to comment.