Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] Corrections for developer mode resolution #75

Merged
merged 1 commit into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion services/Actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class Actions {
to: recipient.includes('whatsapp:') ? recipient : `whatsapp:${recipient}`,
}

if(media_url && !process.env.DEVELOPER_MODE_ON){
if(media_url && !parseInt(process.env.DEVELOPER_MODE_ON)){
body.mediaUrl = [media_url];
}
let data = await client.messages.create(body)
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/controllers/bot.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe('Test cases for Google maps', () => {
expect(source_gps).to.have.property('lng');
})

it.only('It should take a trip plannign input and generate static route image and directions link.', async () => {
it('It should take a trip plannign input and generate static route image and directions link.', async () => {
const ask = "Can you plean a trip from Denver to Yellowstone national park?";

// identify source and destination
Expand Down
8 changes: 8 additions & 0 deletions tests/unit/services/actions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,13 @@ describe('should test send_message()', () => {
expect(error).to.be.an.instanceOf(Error);
}
});

it('Should test sending a message with media', async () => {
const recipient = process.env.TEST_RECEPIENT_NUMBER;
const message = 'This is an image';
const media_url = 'https://becknprotocol.io/wp-content/uploads/2022/03/logo.png';
let status = await actionsService.send_message(recipient, message, media_url);
expect(status.deliveryStatus).to.not.equal('failed')
});
});

Loading