@@ -356,7 +356,7 @@ describe('ParseLiveQueryServer', function () {
356356 // Make sure we add subscriptionInfo to the client
357357 const args = client . addSubscriptionInfo . calls . first ( ) . args ;
358358 expect ( args [ 0 ] ) . toBe ( requestId ) ;
359- expect ( args [ 1 ] . fields ) . toBe ( query . fields ) ;
359+ expect ( args [ 1 ] . keys ) . toBe ( query . keys ) ;
360360 expect ( args [ 1 ] . sessionToken ) . toBe ( request . sessionToken ) ;
361361 // Make sure we send subscribe response to the client
362362 expect ( client . pushSubscribe ) . toHaveBeenCalledWith ( requestId ) ;
@@ -417,7 +417,7 @@ describe('ParseLiveQueryServer', function () {
417417 // Make sure we add subscriptionInfo to the client 2
418418 args = clientAgain . addSubscriptionInfo . calls . mostRecent ( ) . args ;
419419 expect ( args [ 0 ] ) . toBe ( requestIdAgain ) ;
420- expect ( args [ 1 ] . fields ) . toBe ( queryAgain . fields ) ;
420+ expect ( args [ 1 ] . keys ) . toBe ( queryAgain . keys ) ;
421421 } ) ;
422422
423423 it ( 'can handle unsubscribe command without clientId' , function ( ) {
@@ -1081,7 +1081,7 @@ describe('ParseLiveQueryServer', function () {
10811081 done ( ) ;
10821082 } ) ;
10831083
1084- it ( 'can handle create command with fields ' , async done => {
1084+ it ( 'can handle create command with keys ' , async done => {
10851085 jasmine . restoreLibrary ( '../lib/LiveQuery/Client' , 'Client' ) ;
10861086 const Client = require ( '../lib/LiveQuery/Client' ) . Client ;
10871087 const parseLiveQueryServer = new ParseLiveQueryServer ( { } ) ;
@@ -1131,61 +1131,6 @@ describe('ParseLiveQueryServer', function () {
11311131 done ( ) ;
11321132 } ) ;
11331133
1134- it ( 'can deprecate fields' , async ( ) => {
1135- const Deprecator = require ( '../lib/Deprecator/Deprecator' ) ;
1136- const spy = spyOn ( Deprecator , 'logRuntimeDeprecation' ) . and . callFake ( ( ) => { } ) ;
1137- jasmine . restoreLibrary ( '../lib/LiveQuery/Client' , 'Client' ) ;
1138- const Client = require ( '../lib/LiveQuery/Client' ) . Client ;
1139- const parseLiveQueryServer = new ParseLiveQueryServer ( { } ) ;
1140- // Make mock request message
1141- const message = generateMockMessage ( ) ;
1142-
1143- const clientId = 1 ;
1144- const parseWebSocket = {
1145- clientId,
1146- send : jasmine . createSpy ( 'send' ) ,
1147- } ;
1148- const client = new Client ( clientId , parseWebSocket ) ;
1149- spyOn ( client , 'pushCreate' ) . and . callThrough ( ) ;
1150- parseLiveQueryServer . clients . set ( clientId , client ) ;
1151-
1152- // Add mock subscription
1153- const requestId = 2 ;
1154- const query = {
1155- className : testClassName ,
1156- where : {
1157- key : 'value' ,
1158- } ,
1159- fields : [ 'test' ] ,
1160- } ;
1161- await addMockSubscription ( parseLiveQueryServer , clientId , requestId , parseWebSocket , query ) ;
1162- // Mock _matchesSubscription to return matching
1163- parseLiveQueryServer . _matchesSubscription = function ( parseObject ) {
1164- if ( ! parseObject ) {
1165- return false ;
1166- }
1167- return true ;
1168- } ;
1169- parseLiveQueryServer . _matchesACL = function ( ) {
1170- return Promise . resolve ( true ) ;
1171- } ;
1172-
1173- parseLiveQueryServer . _onAfterSave ( message ) ;
1174-
1175- // Make sure we send create command to client
1176- await timeout ( ) ;
1177-
1178- expect ( client . pushCreate ) . toHaveBeenCalled ( ) ;
1179- const args = parseWebSocket . send . calls . mostRecent ( ) . args ;
1180- const toSend = JSON . parse ( args [ 0 ] ) ;
1181- expect ( toSend . object ) . toBeDefined ( ) ;
1182- expect ( toSend . original ) . toBeUndefined ( ) ;
1183- expect ( spy ) . toHaveBeenCalledWith ( {
1184- usage : 'Subscribing using fields parameter' ,
1185- solution : `Subscribe using "keys" instead.` ,
1186- } ) ;
1187- } ) ;
1188-
11891134 it ( 'can handle create command with watch' , async ( ) => {
11901135 jasmine . restoreLibrary ( '../lib/LiveQuery/Client' , 'Client' ) ;
11911136 const Client = require ( '../lib/LiveQuery/Client' ) . Client ;
0 commit comments