]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
tests: test swipe events in Orbit
authorDaniel Ruf <daniel.ruf@ueberbit.de>
Wed, 6 Mar 2019 08:57:03 +0000 (09:57 +0100)
committerDaniel Ruf <daniel.ruf@ueberbit.de>
Wed, 6 Mar 2019 08:57:03 +0000 (09:57 +0100)
test/javascript/components/orbit.js

index 9a1a4584053c349305abc5b5439bc3aee4cc968f..fd62605e011831bd4c989af345127384778dc37a 100644 (file)
@@ -200,6 +200,24 @@ describe('Orbit', function() {
       $html.find('.orbit-slide').eq(0).should.be.hidden;
       $html.find('.orbit-slide').eq(2).should.be.visible;
     });
+    it('changes slides on swipe with data left', function() {
+      $html = $(template).appendTo('body');
+      plugin = new Foundation.Orbit($html, {});
+
+      $html.find('.orbit-slide').eq(0).trigger('swipe', 'left');
+
+      $html.find('.orbit-slide').eq(0).should.be.hidden;
+      $html.find('.orbit-slide').eq(1).should.be.visible;
+    });
+    it('changes slides on swipeleft', function() {
+      $html = $(template).appendTo('body');
+      plugin = new Foundation.Orbit($html, {});
+
+      $html.find('.orbit-slide').eq(0).trigger('swipeleft');
+
+      $html.find('.orbit-slide').eq(0).should.be.hidden;
+      $html.find('.orbit-slide').eq(1).should.be.visible;
+    });
     it('changes slides to the previous one', function() {
       $html = $(template).appendTo('body');
       plugin = new Foundation.Orbit($html, {});