From 0ee618f1930029aee39141c4d06ff6258a20341f Mon Sep 17 00:00:00 2001 From: Mayur Virendra Date: Sun, 31 Mar 2024 16:40:26 +0530 Subject: [PATCH] updated test cases --- tests/apis/bot.test.js | 2 +- tests/unit/services/ai.test.js | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/apis/bot.test.js b/tests/apis/bot.test.js index 4cb659c..c763040 100644 --- a/tests/apis/bot.test.js +++ b/tests/apis/bot.test.js @@ -112,7 +112,7 @@ describe('Test cases for trip planning workflow', ()=>{ expect(response.text).to.be.a('string') }) - it.only('Should try and find another hotel', async () => { + it('Should try and find another hotel', async () => { const response = await request(app).post('/webhook').send({ From: process.env.TEST_RECEPIENT_NUMBER, Body: "Lets confirm!" diff --git a/tests/unit/services/ai.test.js b/tests/unit/services/ai.test.js index e0f6eea..9c34c3c 100644 --- a/tests/unit/services/ai.test.js +++ b/tests/unit/services/ai.test.js @@ -107,6 +107,7 @@ describe('Test cases for get_schema_by_action() function', () => { }) it('Should return false if no action found', async () => { + ai.action = null; const response = await ai.get_schema_by_action(`I'm looking for some hotels`); expect(response).to.be.false; }) @@ -247,10 +248,7 @@ describe('Test cases for services/ai/get_beckn_request_from_text()', () => { expect(response.data.body.context).to.have.property('bpp_uri') expect(response.data.body.message).to.have.property('order') expect(response.data.body.message.order).to.have.property('items') - expect(response.data.body.message.order.items[0]).to.have.property('id') - expect(response.data.body.message.order).to.have.property('billing') - expect(response.data.body.message.order.billing).to.have.property('name') - expect(response.data.body.message.order.billing).to.have.property('email') + expect(response.data.body.message.order.items[0]).to.have.property('id') }); });