@@ -223,44 +223,25 @@ describe('The sms plugin', function () {
223223 } ) ;
224224
225225 it ( 'can request a list of conversations' , async function ( ) {
226- spyOn ( localPlugin , '_handleMessages ' ) ;
226+ spyOn ( localPlugin , '_handleDigest ' ) ;
227227
228228 localPlugin . _requestConversations ( ) ;
229229
230230 await localPlugin . awaitPacket ( 'kdeconnect.sms.messages' ) ;
231- expect ( localPlugin . _handleMessages ) . toHaveBeenCalled ( ) ;
231+ expect ( localPlugin . _handleDigest ) . toHaveBeenCalled ( ) ;
232232 } ) ;
233233
234234 it ( 'can request full conversations' , async function ( ) {
235- spyOn ( localPlugin , '_handleMessages' ) . and . callThrough ( ) ;
236235 spyOn ( localPlugin , '_handleThread' ) . and . callThrough ( ) ;
237236 spyOn ( localPlugin , '_requestConversation' ) . and . callThrough ( ) ;
238237
239- localPlugin . _requestConversations ( ) ;
240-
241- await localPlugin . awaitPacket ( 'kdeconnect.sms.messages' ) ;
242- expect ( localPlugin . _handleMessages ) . toHaveBeenCalled ( ) ;
243- expect ( localPlugin . _requestConversation ) . toHaveBeenCalledTimes ( 2 ) ;
244-
245- localPlugin . handlePacket . calls . reset ( ) ;
238+ localPlugin . requestMore ( '1' , - 1 ) ;
246239
247240 await localPlugin . awaitPacket ( 'kdeconnect.sms.messages' ) ;
241+ expect ( localPlugin . _requestConversation ) . toHaveBeenCalledWith ( '1' , 10 , - 1 ) ;
248242 expect ( localPlugin . _handleThread ) . toHaveBeenCalled ( ) ;
249243 } ) ;
250244
251- it ( 'only requests new or updated converations' , async function ( ) {
252- spyOn ( localPlugin , '_handleMessages' ) . and . callThrough ( ) ;
253- spyOn ( localPlugin , '_handleThread' ) . and . callThrough ( ) ;
254- spyOn ( localPlugin , '_requestConversation' ) . and . callThrough ( ) ;
255-
256- localPlugin . _requestConversations ( ) ;
257-
258- await localPlugin . awaitPacket ( 'kdeconnect.sms.messages' ) ;
259- expect ( localPlugin . _handleMessages ) . toHaveBeenCalled ( ) ;
260-
261- expect ( localPlugin . _requestConversation ) . not . toHaveBeenCalled ( ) ;
262- } ) ;
263-
264245 it ( 'can send SMS messages' , async function ( ) {
265246 spyOn ( remoteDevice , 'handlePacket' ) . and . callThrough ( ) ;
266247
0 commit comments