From afff32957cae4bc20dbb9675621892496237614e Mon Sep 17 00:00:00 2001 From: Marc-Andre Lafortune Date: Fri, 19 Dec 2014 09:05:19 -0500 Subject: [PATCH] Add test for duplicate image [#89] --- test/featherlight_gallery_test.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/test/featherlight_gallery_test.js b/test/featherlight_gallery_test.js index 2915c3f7..cd3b092c 100644 --- a/test/featherlight_gallery_test.js +++ b/test/featherlight_gallery_test.js @@ -117,6 +117,32 @@ var expect = chai.expect; }); }); + describe('$.featherlightGallery', function() { + it ('does not get confused with same images', function(done) { + var imgs = '' + + '' + + ''; + $.featherlightGallery($(imgs), { targetAttr: 'src' }); + $.fx.off = false + patiently(done, [function(){ + expect($('.featherlight img')).to.have.attr('src').match(/photo.jpeg$/); + $('.featherlight').trigger('next'); + }, + function(){ + expect($('.featherlight img')).to.have.css('opacity').lessThan(1); + }, + function(){ + expect($('.featherlight img')).to.have.css('opacity').equal('1'); + $('.featherlight').trigger('next'); + }, + function() { + expect($('.featherlight img')).to.have.attr('src').match(/direct_3$/); + $.fx.off = true; + }]); + }); + }); + + it ('accepts config as data-attributes', function(done) { var $cur; $('#extra-test').featherlightGallery();