11import Component from '@ember/component' ;
22
3+ import { run } from '@ember/runloop' ;
34import { computed } from '@ember/object' ;
45import { observer } from '../../-private/utils/observer' ;
56import { bool , readOnly , or } from '@ember/object/computed' ;
@@ -234,7 +235,9 @@ export default Component.extend({
234235 */
235236 canSelect : bool ( 'onSelect' ) ,
236237
237- 'data-test-row-count' : readOnly ( 'wrappedRows.length' ) ,
238+ dataTestRowCount : null ,
239+
240+ 'data-test-row-count' : readOnly ( 'dataTestRowCount' ) ,
238241
239242 init ( ) {
240243 this . _super ( ...arguments ) ;
@@ -297,7 +300,7 @@ export default Component.extend({
297300
298301 /**
299302 Computed property which updates the CollapseTree and erases caches. This is
300- a computed for 1.11 compatibility, otherwise it would make sense to use
303+ a computed for 1.12 compatibility, otherwise it would make sense to use
301304 lifecycle hooks instead.
302305 */
303306 wrappedRows : computed ( 'rows' , function ( ) {
@@ -306,6 +309,11 @@ export default Component.extend({
306309 this . collapseTree . set ( 'rowMetaCache' , this . rowMetaCache ) ;
307310 this . collapseTree . set ( 'rows' , rows ) ;
308311
312+ run . schedule ( 'actions' , ( ) => {
313+ // eslint-disable-next-line ember-best-practices/no-side-effect-cp
314+ this . set ( 'dataTestRowCount' , this . get ( 'wrappedRows.length' ) ) ; // eslint-disable-line ember/no-side-effects
315+ } ) ;
316+
309317 return this . collapseTree ;
310318 } ) ,
311319
0 commit comments