Skip to content

Commit

Permalink
Added comments on test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
mayurvir committed Apr 8, 2024
1 parent ebe0d5b commit ddbf9d2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/unit/controllers/bot.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ const ai = new AI();
describe('Should test the Bot controller', () => {
it('Should a trip planning use case', async () => {
const ask = "Can you plean a trip from Denver to Yellowstone national park?";

// identify source and destination
const format = {
'source': 'SOURCE_LOCATION',
'destination': 'DESTINATION_LOCATION'
Expand All @@ -17,12 +19,15 @@ describe('Should test the Bot controller', () => {
const details = await ai.get_details_by_description(ask, format);
expect(details).to.have.property('source');
expect(details).to.have.property('destination');


// Get gps for source and destination

const source_gps = await mapService.lookupGps(details.source);
const destination_gps = await mapService.lookupGps(details.destination);

// generate routes
const routes = await mapService.getRoutes(source_gps, destination_gps);
expect(routes).to.be.an('array').that.is.not.empty;
expect(routes).to.be.an('array').that.is.not.empty;
})
})

0 comments on commit ddbf9d2

Please sign in to comment.