import Response from '../src/response'; import Connection from '../src/connection'; describe('handleNoopResponse', () => { it('processes group chat message of user', () => { const response = Response.parse( 'CMDC_RESULT code=2000 reason=OK\r\nCMDC_VALUE _t2=7036\r\nCMDC_VALUE _ds=43\r\nCMDC_CMSG messageKey=23a7d4c627454fcfa033a2314895a497 style=g sound=text msgType=chat from=andrei text=%20message%20from%20another%20user\r\n' ); const connection = new Connection('', '', '', true); let commandsHandlerIsCalled = false; connection['commandsHandler'] = () => { commandsHandlerIsCalled = true; }; connection['handleNoopResponse'](response); expect(commandsHandlerIsCalled).toBeTruthy(); }); });