Enforces spacing around commas

This commit is contained in:
Frederic Junod
2016-12-14 13:42:47 +01:00
parent b1f25d484b
commit 392cbcc138
15 changed files with 46 additions and 46 deletions
+1 -1
View File
@@ -407,7 +407,7 @@ describe('ol.interaction.Draw', function() {
source: source,
type: 'LineString',
finishCondition: function(event) {
if (ol.array.equals(event.coordinate,[30,-20])) {
if (ol.array.equals(event.coordinate, [30, -20])) {
return true;
}
return false;
+15 -15
View File
@@ -74,17 +74,17 @@ describe('ol.interaction.Extent', function() {
}
describe('snap to vertex', function() {
it('snap to vertex works', function() {
interaction.setExtent([-50,-50,50,50]);
interaction.setExtent([-50, -50, 50, 50]);
expect(interaction.snapToVertex_([230,40], map)).to.eql([50,50]);
expect(interaction.snapToVertex_([231,41], map)).to.eql([50,50]);
expect(interaction.snapToVertex_([230, 40], map)).to.eql([50, 50]);
expect(interaction.snapToVertex_([231, 41], map)).to.eql([50, 50]);
});
it('snap to edge works', function() {
interaction.setExtent([-50,-50,50,50]);
interaction.setExtent([-50, -50, 50, 50]);
expect(interaction.snapToVertex_([230,90], map)).to.eql([50,0]);
expect(interaction.snapToVertex_([230,89], map)).to.eql([50,1]);
expect(interaction.snapToVertex_([231,90], map)).to.eql([50,0]);
expect(interaction.snapToVertex_([230, 90], map)).to.eql([50, 0]);
expect(interaction.snapToVertex_([230, 89], map)).to.eql([50, 1]);
expect(interaction.snapToVertex_([231, 90], map)).to.eql([50, 0]);
});
});
@@ -95,11 +95,11 @@ describe('ol.interaction.Extent', function() {
simulateEvent('pointerdrag', 50, 50, false, 0);
simulateEvent('pointerup', 50, 50, false, 0);
expect(interaction.getExtent()).to.eql([-50,-50,50,50]);
expect(interaction.getExtent()).to.eql([-50, -50, 50, 50]);
});
it('clicking off extent nulls extent', function() {
interaction.setExtent([-50,-50,50,50]);
interaction.setExtent([-50, -50, 50, 50]);
simulateEvent('pointerdown', -10, -10, false, 0);
simulateEvent('pointerup', -10, -10, false, 0);
@@ -108,32 +108,32 @@ describe('ol.interaction.Extent', function() {
});
it('clicking on extent does not null extent', function() {
interaction.setExtent([-50,-50,50,50]);
interaction.setExtent([-50, -50, 50, 50]);
simulateEvent('pointerdown', 50, 50, false, 0);
simulateEvent('pointerup', 50, 50, false, 0);
expect(interaction.getExtent()).to.eql([-50,-50,50,50]);
expect(interaction.getExtent()).to.eql([-50, -50, 50, 50]);
});
it('snap and drag vertex works', function() {
interaction.setExtent([-50,-50,50,50]);
interaction.setExtent([-50, -50, 50, 50]);
simulateEvent('pointerdown', 51, 49, false, 0);
simulateEvent('pointerdrag', -70, -40, false, 0);
simulateEvent('pointerup', -70, -40, false, 0);
expect(interaction.getExtent()).to.eql([-70,-50,-50,-40]);
expect(interaction.getExtent()).to.eql([-70, -50, -50, -40]);
});
it('snap and drag edge works', function() {
interaction.setExtent([-50,-50,50,50]);
interaction.setExtent([-50, -50, 50, 50]);
simulateEvent('pointerdown', 51, 5, false, 0);
simulateEvent('pointerdrag', 20, -30, false, 0);
simulateEvent('pointerup', 20, -30, false, 0);
expect(interaction.getExtent()).to.eql([-50,-50,20,50]);
expect(interaction.getExtent()).to.eql([-50, -50, 20, 50]);
});
});
});