@@ -530,30 +530,31 @@ describe('LIVECHAT - Agents', () => {
530530 room = await createLivechatRoom ( visitor . token ) ;
531531 } ) ;
532532 after ( async ( ) => {
533- await deleteVisitor ( visitor . token ) ;
534533 await closeOmnichannelRoom ( room . _id ) ;
534+ await deleteVisitor ( visitor . token ) ;
535535 } ) ;
536536 it ( 'should fail when token in url params is not valid' , async ( ) => {
537537 await request . get ( api ( `livechat/agent.next/invalid-token` ) ) . expect ( 400 ) ;
538538 } ) ;
539539 it ( 'should return success when visitor with token has an open room' , async ( ) => {
540540 await request . get ( api ( `livechat/agent.next/${ visitor . token } ` ) ) . expect ( 200 ) ;
541541 } ) ;
542- describe ( 'with manual selection' , ( ) => {
543- before ( async ( ) => {
544- await updateSetting ( 'Livechat_Routing_Method' , 'Manual_Selection' ) ;
545- } ) ;
546- after ( async ( ) => {
547- await updateSetting ( 'Livechat_Routing_Method' , 'Auto_Selection' ) ;
548- } ) ;
549- it ( 'should fail if theres no open room for visitor and algo is manual selection' , async ( ) => {
550- const visitor = await createVisitor ( ) ;
551542
552- await request . get ( api ( `livechat/agent.next/${ visitor . token } ` ) ) . expect ( 400 ) ;
553- } ) ;
543+ // TODO: test cases when algo is Auto_Selection
544+ } ) ;
545+
546+ describe ( 'livechat/agent.next/:token - with manual selection' , ( ) => {
547+ before ( async ( ) => {
548+ await updateSetting ( 'Livechat_Routing_Method' , 'Manual_Selection' ) ;
549+ } ) ;
550+ after ( async ( ) => {
551+ await updateSetting ( 'Livechat_Routing_Method' , 'Auto_Selection' ) ;
554552 } ) ;
553+ it ( 'should fail if theres no open room for visitor and algo is manual selection' , async ( ) => {
554+ const visitor = await createVisitor ( ) ;
555555
556- // TODO: test cases when algo is Auto_Selection
556+ await request . get ( api ( `livechat/agent.next/${ visitor . token } ` ) ) . expect ( 400 ) ;
557+ } ) ;
557558 } ) ;
558559
559560 describe ( 'livechat/agent.status' , ( ) => {
0 commit comments