Skip to content

Commit

Permalink
QUnit: add beforeselect event test
Browse files Browse the repository at this point in the history
  • Loading branch information
basti1253 committed Jan 19, 2014
1 parent 25f9ed5 commit 6412999
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/qunit/all/methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,25 @@
deepEqual( endAttrs, childOriginalAttrs[ i ], "Element attributes match for child " + i + " after destroy" );
});
});

asyncTest( 'beforeselect event returns correct item', function() {

var items = this.items;

this.el
.coverflow({
active : 0,
duration : 1
})
.one( 'coverflowselect', function( ev, ui ) {

equal( 1, ui.index, 'beforeselect event triggers new index' )
deepEqual( ui.active.get(0), items.eq( 1 ).get(0), 'active element before select matches first image.' );

start();
})
.coverflow( 'select', 1 );

expect( 2 );
});
})( jQuery );

0 comments on commit 6412999

Please sign in to comment.