@@ -2,6 +2,7 @@ import { module, test } from 'qunit';
2
2
import { setupApplicationTest } from 'ember-qunit' ;
3
3
4
4
import { click , find , findAll , visit as newVisit } from '@ember/test-helpers' ;
5
+ import scrollTo from '../../helpers/scroll-to' ;
5
6
6
7
module ( 'Acceptance | Record Array' , function ( hooks ) {
7
8
setupApplicationTest ( hooks ) ;
@@ -14,6 +15,42 @@ module('Acceptance | Record Array', function(hooks) {
14
15
assert . equal ( find ( 'number-slide:last-of-type' ) . textContent . replace ( / \s / g, '' ) , '14(14)' , 'correct last item rendered' ) ;
15
16
} ) ;
16
17
18
+ test ( 'RecordArrays update correctly after scrolling and updating items' , async function ( assert ) {
19
+ await newVisit ( '/acceptance-tests/record-array' ) ;
20
+
21
+ assert . equal ( findAll ( 'number-slide' ) . length , 15 , 'correct number of items rendered' ) ;
22
+
23
+ await scrollTo ( '.table-wrapper' , 0 , 600 ) ;
24
+
25
+ await click ( '#update-items-button' ) ;
26
+
27
+ assert . equal ( findAll ( 'number-slide' ) . length , 5 , 'correct number of items rendered' ) ;
28
+ } ) ;
29
+
30
+ test ( 'RecordArrays update correctly after partial update' , async function ( assert ) {
31
+ await newVisit ( '/acceptance-tests/record-array' ) ;
32
+
33
+ assert . equal ( findAll ( 'number-slide' ) . length , 15 , 'correct number of items rendered' ) ;
34
+
35
+ await click ( '#partial-update-button' ) ;
36
+
37
+ assert . equal ( findAll ( 'number-slide' ) . length , 5 , 'correct number of items rendered' ) ;
38
+ } ) ;
39
+
40
+ test ( 'RecordArrays update correctly after being hidden and shown' , async function ( assert ) {
41
+ await newVisit ( '/acceptance-tests/record-array' ) ;
42
+
43
+ assert . equal ( findAll ( 'number-slide' ) . length , 15 , 'correct number of items rendered' ) ;
44
+
45
+ await click ( '#hide-vc-button' ) ;
46
+
47
+ assert . equal ( findAll ( 'number-slide' ) . length , 0 , 'correct number of items rendered' ) ;
48
+
49
+ await click ( '#show-vc-button' ) ;
50
+
51
+ assert . equal ( findAll ( 'number-slide' ) . length , 15 , 'correct number of items rendered' ) ;
52
+ } ) ;
53
+
17
54
test ( 'RecordArrays updates correctly after deleting items' , async function ( assert ) {
18
55
await newVisit ( '/acceptance-tests/record-array' ) ;
19
56
0 commit comments