@@ -356,7 +356,7 @@ describe('ParseLiveQueryServer', function () {
356
356
// Make sure we add subscriptionInfo to the client
357
357
const args = client . addSubscriptionInfo . calls . first ( ) . args ;
358
358
expect ( args [ 0 ] ) . toBe ( requestId ) ;
359
- expect ( args [ 1 ] . fields ) . toBe ( query . fields ) ;
359
+ expect ( args [ 1 ] . keys ) . toBe ( query . keys ) ;
360
360
expect ( args [ 1 ] . sessionToken ) . toBe ( request . sessionToken ) ;
361
361
// Make sure we send subscribe response to the client
362
362
expect ( client . pushSubscribe ) . toHaveBeenCalledWith ( requestId ) ;
@@ -417,7 +417,7 @@ describe('ParseLiveQueryServer', function () {
417
417
// Make sure we add subscriptionInfo to the client 2
418
418
args = clientAgain . addSubscriptionInfo . calls . mostRecent ( ) . args ;
419
419
expect ( args [ 0 ] ) . toBe ( requestIdAgain ) ;
420
- expect ( args [ 1 ] . fields ) . toBe ( queryAgain . fields ) ;
420
+ expect ( args [ 1 ] . keys ) . toBe ( queryAgain . keys ) ;
421
421
} ) ;
422
422
423
423
it ( 'can handle unsubscribe command without clientId' , function ( ) {
@@ -1081,7 +1081,7 @@ describe('ParseLiveQueryServer', function () {
1081
1081
done ( ) ;
1082
1082
} ) ;
1083
1083
1084
- it ( 'can handle create command with fields ' , async done => {
1084
+ it ( 'can handle create command with keys ' , async done => {
1085
1085
jasmine . restoreLibrary ( '../lib/LiveQuery/Client' , 'Client' ) ;
1086
1086
const Client = require ( '../lib/LiveQuery/Client' ) . Client ;
1087
1087
const parseLiveQueryServer = new ParseLiveQueryServer ( { } ) ;
@@ -1131,61 +1131,6 @@ describe('ParseLiveQueryServer', function () {
1131
1131
done ( ) ;
1132
1132
} ) ;
1133
1133
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
-
1189
1134
it ( 'can handle create command with watch' , async ( ) => {
1190
1135
jasmine . restoreLibrary ( '../lib/LiveQuery/Client' , 'Client' ) ;
1191
1136
const Client = require ( '../lib/LiveQuery/Client' ) . Client ;
0 commit comments