Merge pull request #565 from danvk/gulp
[dygraphs.git] / auto_tests / tests / visibility.js
index 77f2ea6..e8860c6 100644 (file)
@@ -3,14 +3,14 @@
  * @author sergeyslepian@gmail.com
  */
 
-var VisibilityTestCase = TestCase("visibility");
+describe("visibility", function() {
 
-VisibilityTestCase.prototype.setUp = function() {
+beforeEach(function() {
   document.body.innerHTML = "<div id='graph'></div>";
-};
+});
 
-VisibilityTestCase.prototype.tearDown = function() {
-};
+afterEach(function() {
+});
 
 /**
  * Does a bunch of the shared busywork of setting up a graph and changing its visibility.
@@ -18,7 +18,7 @@ VisibilityTestCase.prototype.tearDown = function() {
  * @param {*[]} setVisibilityArgs An array of arguments to be passed directly to setVisibility()
  * @returns {string} The output of Util.getLegend() called after the visibility is set
  */
-VisibilityTestCase.prototype.getVisibleSeries = function(startingVisibility, setVisibilityArgs) {
+var getVisibleSeries = function(startingVisibility, setVisibilityArgs) {
   var opts = {
     width: 480,
     height: 320,
@@ -46,23 +46,25 @@ VisibilityTestCase.prototype.getVisibleSeries = function(startingVisibility, set
   return Util.getLegend();
 };
 
-VisibilityTestCase.prototype.testDefaultCases = function() {
-  assertEquals(' A  B  C  D  E', this.getVisibleSeries(true, [[], true]));
-  assertEquals('', this.getVisibleSeries(false, [[], true]));
-};
+it('testDefaultCases', function() {
+  assert.equal(' A  B  C  D  E', getVisibleSeries(true, [[], true]));
+  assert.equal('', getVisibleSeries(false, [[], true]));
+});
 
-VisibilityTestCase.prototype.testSingleSeriesHide = function() {
-  assertEquals(' A  C  D  E', this.getVisibleSeries(true, [1, false]));
-};
+it('testSingleSeriesHide', function() {
+  assert.equal(' A  C  D  E', getVisibleSeries(true, [1, false]));
+});
 
-VisibilityTestCase.prototype.testSingleSeriesShow = function() {
-  assertEquals(' E', this.getVisibleSeries(false, [4, true]));
-};
+it('testSingleSeriesShow', function() {
+  assert.equal(' E', getVisibleSeries(false, [4, true]));
+});
 
-VisibilityTestCase.prototype.testMultiSeriesHide = function() {
-  assertEquals(' A  E', this.getVisibleSeries(true, [[1,2,3], false]));
-};
+it('testMultiSeriesHide', function() {
+  assert.equal(' A  E', getVisibleSeries(true, [[1,2,3], false]));
+});
+
+it('testMultiSeriesShow', function() {
+  assert.equal(' B  D', getVisibleSeries(false, [[1,3], true]));
+});
 
-VisibilityTestCase.prototype.testMultiSeriesShow = function() {
-  assertEquals(' B  D', this.getVisibleSeries(false, [[1,3], true]));
-};
\ No newline at end of file
+});