From 3ad0d6adc026c620af1b2eaadabd2ce2c338e2f1 Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Tue, 22 Apr 2014 15:58:21 +0200 Subject: [PATCH] tests for lazy loading --- test/test.html | 5 +++++ test/test.js | 12 ++++++++++++ 2 files changed, 17 insertions(+) diff --git a/test/test.html b/test/test.html index aa233c81..31c31dd8 100644 --- a/test/test.html +++ b/test/test.html @@ -21,6 +21,11 @@

1

+ +
diff --git a/test/test.js b/test/test.js index 90a002a4..367373e5 100644 --- a/test/test.js +++ b/test/test.js @@ -449,6 +449,18 @@ Reveal.addEventListener( 'ready', function() { }); + // --------------------------------------------------------------- + // LAZY-LOADING TESTS + + QUnit.module( 'Lazy-Loading' ); + + test( 'img with data-src', function() { + strictEqual( document.querySelectorAll( '.reveal section img[src]' ).length, 1, 'Image source has been set' ); + + strictEqual( document.querySelectorAll( '.reveal section video source[src]' ).length, 2, 'Video sources have been set' ); + }); + + // --------------------------------------------------------------- // EVENT TESTS