From d28b365dda010506854d003ad8aa2754d411aff8 Mon Sep 17 00:00:00 2001 From: Stephen Williams Date: Wed, 19 Apr 2017 11:46:25 -0400 Subject: [PATCH] update repeater test to only assert on appropriate instance of trigger --- test/repeater-test.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/test/repeater-test.js b/test/repeater-test.js index 6d83bab72..3d6e05396 100644 --- a/test/repeater-test.js +++ b/test/repeater-test.js @@ -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(); } } );