]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
In JS tests, only use should, not expect/should mixed
authorGeoff Kimball <geoff@zurb.com>
Tue, 1 Mar 2016 18:40:15 +0000 (10:40 -0800)
committerGeoff Kimball <geoff@zurb.com>
Tue, 1 Mar 2016 18:40:15 +0000 (10:40 -0800)
test/javascript/components/toggler.js
test/javascript/tests.js

index 25b3039c1d741c6cf9e6bc61acefd6b1f51256aa..6866b7458f767763d537b5527599905bdfa5051d 100644 (file)
@@ -1,5 +1,4 @@
-var expect = chai.expect;
-var should = chai.should();
+chai.should();
 
 describe('Toggler', function() {
   var plugin;
@@ -15,8 +14,8 @@ describe('Toggler', function() {
       $html = $('<div id="toggler" data-toggler="class"></div>').appendTo('body');
       plugin = new Foundation.Toggler($html, {});
 
-      expect(plugin.$element).to.be.an('object');
-      expect(plugin.options).to.be.an('object');
+      plugin.$element.should.be.an('object');
+      plugin.options.should.be.an('object');
     });
   });
 
@@ -25,22 +24,22 @@ describe('Toggler', function() {
       $html = $('<div id="toggler" data-toggler="class"></div>').appendTo('body');
       plugin = new Foundation.Toggler($html, {});
 
-      expect(plugin.className).to.equal('class');
+      plugin.className.should.equal('class');
     });
 
     it('stores the class defined on the data-toggler attribute (with leading dot)', function() {
       $html = $('<div id="toggler" data-toggler=".class"></div>').appendTo('body');
       plugin = new Foundation.Toggler($html, {});
 
-      expect(plugin.className).to.equal('class');
+      plugin.className.should.equal('class');
     });
 
     it('stores defined animation classes', function() {
       $html = $('<div id="toggler" data-toggler data-animate="fade-in fade-out"></div>').appendTo('body');
       plugin = new Foundation.Toggler($html, {});
 
-      expect(plugin.animationIn).to.equal('fade-in');
-      expect(plugin.animationOut).to.equal('fade-out');
+      plugin.animationIn.should.equal('fade-in');
+      plugin.animationOut.should.equal('fade-out');
     });
 
     it('adds Aria attributes to click triggers', function() {
index c6bcb858ea128d87c0645f068697691f8a6c6a48..a91fa5427ff4b88f5d7bb65a12beb2b8c7d67a9d 100644 (file)
@@ -1,7 +1,7 @@
-var expect = chai.expect;
+chai.should();
 
-describe('Foundation', function() {
+describe('Foundation core', function() {
   it('should be a jQuery prototype function', function() {
-    expect($.fn.foundation).to.be.a('function');
+    ($.fn.foundation).should.to.be.a('function');
   });
 });