Skip to content
This repository has been archived by the owner on Jan 21, 2021. It is now read-only.

Commit

Permalink
tests for issue #11
Browse files Browse the repository at this point in the history
  • Loading branch information
aFarkas committed Oct 11, 2014
1 parent 80c2878 commit 5cb401b
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/tests-mutations.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,30 @@
}, 9);
});

asyncTest( "mutationobserver: changing sizes recalculates candidate", function() {
var $img = $( "<img sizes='10px' srcset='small.jpg 30w, medium.jpg 99w' />");



$("#mutation-fixture").append( $img );

setTimeout(function() {
var oldCurSrc = $img.prop('currentSrc');
var oldSrc = $img.prop('src');

$img.attr('sizes', '100px')

setTimeout(function(){
ok(oldCurSrc.indexOf('small.jpg') != -1);
ok(oldSrc.indexOf('small.jpg') != -1);
ok($img.prop('currentSrc').indexOf('medium.jpg') != -1);
ok($img.prop('src').indexOf('medium.jpg') != -1);

start();
}, 9);
}, 9);
});

asyncTest( "mutationobserver: functional integration test append", function() {
var markup = $( "#template").html();

Expand Down

0 comments on commit 5cb401b

Please sign in to comment.