projects
/
dygraphs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
create failing errorBars test
[dygraphs.git]
/
auto_tests
/
tests
/
range_tests.js
diff --git
a/auto_tests/tests/range_tests.js
b/auto_tests/tests/range_tests.js
index
846241e
..
c92c489
100644
(file)
--- a/
auto_tests/tests/range_tests.js
+++ b/
auto_tests/tests/range_tests.js
@@
-1,4
+1,4
@@
-// Copyright (c)
2011 Google, Inc.
+// Copyright (c) 2011 Google, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@
-70,8
+70,12
@@
RangeTestCase.prototype.testRangeSetOperations = function() {
g.updateOptions({ });
assertEquals([12, 18], g.xAxisRange());
assertEquals([10, 40], g.yAxisRange(0));
g.updateOptions({ });
assertEquals([12, 18], g.xAxisRange());
assertEquals([10, 40], g.yAxisRange(0));
+
+ g.updateOptions({valueRange : null, axes: {y:{valueRange : [15, 20]}}});
+ assertEquals([12, 18], g.xAxisRange());
+ assertEquals([15, 20], g.yAxisRange(0));
- g.updateOptions({ dateWindow : null, valueRange : null });
+ g.updateOptions({ dateWindow : null, valueRange : null
, axes: null
});
assertEquals([10, 20], g.xAxisRange());
assertEquals([0, 55], g.yAxisRange(0));
};
assertEquals([10, 20], g.xAxisRange());
assertEquals([0, 55], g.yAxisRange(0));
};
@@
-84,8
+88,7
@@
RangeTestCase.prototype.zoom = function(g, xRange, yRange) {
var originalXRange = g.xAxisRange();
var originalYRange = g.yAxisRange(0);
var originalXRange = g.xAxisRange();
var originalYRange = g.yAxisRange(0);
- // Editing e.shiftKey post construction doesn't work for Firefox. Damn.
- DygraphOps.dispatchMouseDown(g, xRange[0], yRange[0], function(e) { e.shiftKey = true; });
+ DygraphOps.dispatchMouseDown(g, xRange[0], yRange[0]);
DygraphOps.dispatchMouseMove(g, xRange[1], yRange[0]); // this is really necessary.
DygraphOps.dispatchMouseUp(g, xRange[1], yRange[0]);
DygraphOps.dispatchMouseMove(g, xRange[1], yRange[0]); // this is really necessary.
DygraphOps.dispatchMouseUp(g, xRange[1], yRange[0]);
@@
-93,7
+96,7
@@
RangeTestCase.prototype.zoom = function(g, xRange, yRange) {
// assertEqualsDelta(originalYRange, g.yAxisRange(0), 0.2); // Not true, it's something in the middle.
var midX = (xRange[1] - xRange[0]) / 2;
// assertEqualsDelta(originalYRange, g.yAxisRange(0), 0.2); // Not true, it's something in the middle.
var midX = (xRange[1] - xRange[0]) / 2;
- DygraphOps.dispatchMouseDown(g, midX, yRange[0]
, function(e) { e.shiftKey = true; }
);
+ DygraphOps.dispatchMouseDown(g, midX, yRange[0]);
DygraphOps.dispatchMouseMove(g, midX, yRange[1]); // this is really necessary.
DygraphOps.dispatchMouseUp(g, midX, yRange[1]);
DygraphOps.dispatchMouseMove(g, midX, yRange[1]); // this is really necessary.
DygraphOps.dispatchMouseUp(g, midX, yRange[1]);
@@
-110,6
+113,9
@@
RangeTestCase.prototype.testEmptyUpdateOptions_doesntUnzoom = function() {
var g = this.createGraph();
this.zoom(g, [ 11, 18 ], [ 35, 40 ]);
var g = this.createGraph();
this.zoom(g, [ 11, 18 ], [ 35, 40 ]);
+ assertEqualsDelta([11, 18], g.xAxisRange(), 0.1);
+ assertEqualsDelta([35, 40], g.yAxisRange(0), 0.2);
+
g.updateOptions({});
assertEqualsDelta([11, 18], g.xAxisRange(), 0.1);
g.updateOptions({});
assertEqualsDelta([11, 18], g.xAxisRange(), 0.1);