diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/test.html | 5 | ||||
-rw-r--r-- | test/test.js | 12 |
2 files changed, 17 insertions, 0 deletions
diff --git a/test/test.html b/test/test.html index aa233c8..31c31dd 100644 --- a/test/test.html +++ b/test/test.html @@ -21,6 +21,11 @@ <section> <h1>1</h1> + <img data-src="fake-url.png"> + <video> + <source data-src="fake-url.mp4" /> + <source data-src="fake-url.webm" /> + </video> </section> <section> diff --git a/test/test.js b/test/test.js index 90a002a..367373e 100644 --- a/test/test.js +++ b/test/test.js @@ -450,6 +450,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 QUnit.module( 'Events' ); |