File tree Expand file tree Collapse file tree 3 files changed +20
-8
lines changed
test/components/submission Expand file tree Collapse file tree 3 files changed +20
-8
lines changed Original file line number Diff line number Diff line change @@ -266,11 +266,8 @@ export default {
266266 }
267267 ),
268268 clear: clear && ! refresh,
269- patch: (loaded > 0 && ! clear) || (loaded > 0 && refresh)
270- ? (response ) => {
271- if (clear && refresh) this .odata .removeData ();
272- this .odata .addChunk (response .data );
273- }
269+ patch: loaded > 0 && ! clear && ! refresh
270+ ? (response ) => this .odata .addChunk (response .data )
274271 : null
275272 })
276273 .finally (() => { this .refreshing = false ; })
Original file line number Diff line number Diff line change @@ -32,9 +32,6 @@ export default () => {
3232 nextLink : data [ '@odata.nextLink' ]
3333 } ) ;
3434 } ,
35- removeData ( ) {
36- odata . value . splice ( 0 , odata . value . length ) ;
37- } ,
3835 addChunk ( chunk ) {
3936 for ( const submission of chunk . value ) {
4037 odata . value . push ( submission ) ;
Original file line number Diff line number Diff line change @@ -112,6 +112,24 @@ describe('SubmissionList', () => {
112112 } )
113113 . respondWithData ( testData . submissionOData ) ;
114114 } ) ;
115+
116+ it ( 'should show correct row number after refresh' , ( ) => {
117+ testData . extendedSubmissions . createPast ( 1 ) ;
118+ return loadSubmissionList ( )
119+ . complete ( )
120+ . request ( component =>
121+ component . get ( '#submission-list-refresh-button' ) . trigger ( 'click' ) )
122+ . beforeEachResponse ( component => {
123+ testData . extendedSubmissions . createPast ( 1 ) ;
124+ component . get ( '#odata-loading-message' ) . should . be . hidden ( ) ;
125+ } )
126+ . respondWithData ( testData . submissionOData )
127+ . afterResponse ( component => {
128+ component . findAllComponents ( SubmissionMetadataRow ) . forEach ( ( r , i ) => {
129+ r . props ( ) . rowNumber . should . be . equal ( 2 - i ) ;
130+ } ) ;
131+ } ) ;
132+ } ) ;
115133 } ) ;
116134
117135 describe ( 'load by chunk' , ( ) => {
You can’t perform that action at this time.
0 commit comments