@@ -368,11 +368,11 @@ describe('batch', () => {
368
368
it ( 'should generate separate session for each call' , async ( ) => {
369
369
await reconfigureServer ( ) ;
370
370
const myObject = new Parse . Object ( 'MyObject' ) ; // This is important because transaction only works on pre-existing collections
371
- await myObject . save ( ) ;
371
+ await myObject . save ( { key : 'stringField' } ) ;
372
372
await myObject . destroy ( ) ;
373
373
374
374
const myObject2 = new Parse . Object ( 'MyObject2' ) ; // This is important because transaction only works on pre-existing collections
375
- await myObject2 . save ( ) ;
375
+ await myObject2 . save ( { key : 'stringField' } ) ;
376
376
await myObject2 . destroy ( ) ;
377
377
createSpy . calls . reset ( ) ;
378
378
@@ -381,6 +381,7 @@ describe('batch', () => {
381
381
myObjectCalls ++ ;
382
382
if ( myObjectCalls === 2 ) {
383
383
try {
384
+ // Saving a number to a string field should fail
384
385
await request ( {
385
386
method : 'POST' ,
386
387
headers : headers ,
@@ -547,14 +548,14 @@ describe('batch', () => {
547
548
const results3 = await query3 . find ( ) ;
548
549
expect ( results3 . map ( result => result . get ( 'key' ) ) . sort ( ) ) . toEqual ( [ 'value1' , 'value2' ] ) ;
549
550
550
- expect ( databaseAdapter . createObject . calls . count ( ) >= 13 ) . toEqual ( true ) ;
551
+ expect ( createSpy . calls . count ( ) >= 13 ) . toEqual ( true ) ;
551
552
let transactionalSession ;
552
553
let transactionalSession2 ;
553
554
let myObjectDBCalls = 0 ;
554
555
let myObject2DBCalls = 0 ;
555
556
let myObject3DBCalls = 0 ;
556
- for ( let i = 0 ; i < databaseAdapter . createObject . calls . count ( ) ; i ++ ) {
557
- const args = databaseAdapter . createObject . calls . argsFor ( i ) ;
557
+ for ( let i = 0 ; i < createSpy . calls . count ( ) ; i ++ ) {
558
+ const args = createSpy . calls . argsFor ( i ) ;
558
559
switch ( args [ 0 ] ) {
559
560
case 'MyObject' :
560
561
myObjectDBCalls ++ ;
0 commit comments