projects
/
dygraphs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Bump to version 2 🎉
[dygraphs.git]
/
auto_tests
/
tests
/
update_options.js
diff --git
a/auto_tests/tests/update_options.js
b/auto_tests/tests/update_options.js
index
ea3dfaa
..
e581110
100644
(file)
--- a/
auto_tests/tests/update_options.js
+++ b/
auto_tests/tests/update_options.js
@@
-4,7
+4,12
@@
* @fileoverview Tests for the updateOptions function.
* @author antrob@google.com (Anthony Robledo)
*/
* @fileoverview Tests for the updateOptions function.
* @author antrob@google.com (Anthony Robledo)
*/
+
+import Dygraph from '../../src/dygraph';
+
describe("update-options", function() {
describe("update-options", function() {
+
+cleanupAfterEach();
var opts = {
width: 480,
var opts = {
width: 480,
@@
-18,13
+23,6
@@
var data = "X,Y1,Y2\n" +
"2011-04-04,9,5\n" +
"2011-05-05,8,3\n";
"2011-04-04,9,5\n" +
"2011-05-05,8,3\n";
-beforeEach(function() {
- document.body.innerHTML = "<div id='graph'></div><div id='labels'></div>";
-});
-
-afterEach(function() {
-});
-
/*
* Tweaks the dygraph so it sets g._testDrawCalled to true when internal method
* drawGraph_ is called. Call unWrapDrawGraph when done with this.
/*
* Tweaks the dygraph so it sets g._testDrawCalled to true when internal method
* drawGraph_ is called. Call unWrapDrawGraph when done with this.
@@
-133,7
+131,7
@@
it('testUpdateColors', function() {
var colors1 = [ "#aaa", "#bbb" ];
graph.updateOptions({ colors: colors1 });
var colors1 = [ "#aaa", "#bbb" ];
graph.updateOptions({ colors: colors1 });
- assert.
e
qual(colors1, graph.getColors());
+ assert.
deepE
qual(colors1, graph.getColors());
// extra colors are ignored until you add additional data series.
var colors2 = [ "#ddd", "#eee", "#fff" ];
// extra colors are ignored until you add additional data series.
var colors2 = [ "#ddd", "#eee", "#fff" ];
@@
-145,10
+143,10
@@
it('testUpdateColors', function() {
"2011-01-01,2,3,4\n" +
"2011-02-02,5,3,2\n"
});
"2011-01-01,2,3,4\n" +
"2011-02-02,5,3,2\n"
});
- assert.
e
qual(colors2, graph.getColors());
+ assert.
deepE
qual(colors2, graph.getColors());
graph.updateOptions({ colors: null, file: data });
graph.updateOptions({ colors: null, file: data });
- assert.
e
qual(defaultColors, graph.getColors());
+ assert.
deepE
qual(defaultColors, graph.getColors());
});
// Regression test for http://code.google.com/p/dygraphs/issues/detail?id=249
});
// Regression test for http://code.google.com/p/dygraphs/issues/detail?id=249