File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 470470 var done = assert . async ( ) ;
471471
472472 var store = createStore ( {
473+ key : "this" ,
473474 loadUrl : "/" ,
474475 loadMode : "raw" ,
475476 onBeforeSend : function ( op , ajax ) {
486487
487488 willRespondWithJson ( { data : [ 0 , 1 , 2 , 3 ] } ) ;
488489
489- store . load ( loadOptions ) . done ( function ( r ) {
490- assert . deepEqual ( r , [ 2 , 1 ] ) ;
491- done ( ) ;
492- } ) ;
490+ Promise . all ( [
491+
492+ store . load ( loadOptions ) . done ( function ( r ) {
493+ assert . deepEqual ( r , [ 2 , 1 ] ) ;
494+ } ) ,
495+
496+ store . byKey ( 3 ) . done ( function ( obj ) {
497+ assert . equal ( obj , 3 ) ;
498+ } ) ,
499+
500+ store . totalCount ( ) . done ( function ( count ) {
501+ assert . equal ( count , 4 ) ;
502+ } )
503+
504+ ] ) . then ( done ) ;
493505 } ) ;
494506 } ) ;
495507
Original file line number Diff line number Diff line change 4747 loadUrl = options . loadUrl ,
4848 loadMethod = options . loadMethod || "GET" ,
4949 loadParams = options . loadParams ,
50+ isRawLoadMode = options . loadMode === "raw" ,
5051 updateUrl = options . updateUrl ,
5152 insertUrl = options . insertUrl ,
5253 deleteUrl = options . deleteUrl ,
182183 ) ;
183184 } ,
184185
185- totalCount : function ( loadOptions ) {
186+ totalCount : ! isRawLoadMode && function ( loadOptions ) {
186187 return send (
187188 "load" ,
188189 false ,
199200 ) ;
200201 } ,
201202
202- byKey : function ( key ) {
203+ byKey : ! isRawLoadMode && function ( key ) {
203204 return send (
204205 "load" ,
205206 true ,
You can’t perform that action at this time.
0 commit comments