Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Commit

Permalink
update repeater test to only assert on appropriate instance of trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
swilliamset committed Apr 19, 2017
1 parent 8f24eab commit de36f31
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions test/repeater-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -380,14 +380,12 @@ define( function ( require ) {
QUnit.test( 'rendered.fu.repeater callback should receive correct data when called by renderItems function', function dataSourceCallbackTest( assert ) {
var ready = assert.async();
var $repeater = $( this.$markup );
var count = 0;
$repeater.on( 'rendered.fu.repeater', function rendered ( e, state ) {
count++;
// rendered is triggered on `this.$search` and `this.$element` in repeater.js
if ( e.target.id === $repeater.attr('id') ) {
assert.ok( state.data, 'data object exists' );
assert.equal( state.data.myVar, 'passalong', 'data returned from datasource was passed along' );

assert.ok( state.data, 'data object exists' );
assert.equal( state.data.myVar, 'passalong', 'data returned from datasource was passed along' );

if ( count === 2 ) {
ready();
}
} );
Expand Down

0 comments on commit de36f31

Please sign in to comment.