From 81def62a0380b553ccab6029af90118bdc55b547 Mon Sep 17 00:00:00 2001 From: khang Date: Wed, 17 Aug 2022 18:33:53 -0400 Subject: [PATCH] fix tests --- test/applications.js | 6 +++--- test/auth.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/applications.js b/test/applications.js index 5ede901..4728cab 100644 --- a/test/applications.js +++ b/test/applications.js @@ -60,8 +60,8 @@ test('application tests', async(t) => { auth: authAdmin, json: true, }); - t.ok(result[0].name === 'daveh' , 'successfully retrieved application by sid'); - t.ok(result[0].messaging_hook.url === 'http://example.com/sms' , 'successfully retrieved messaging_hook from application'); + t.ok(result.name === 'daveh' , 'successfully retrieved application by sid'); + t.ok(result.messaging_hook.url === 'http://example.com/sms' , 'successfully retrieved messaging_hook from application'); /* update applications */ result = await request.put(`/Applications/${sid}`, { @@ -84,7 +84,7 @@ test('application tests', async(t) => { auth: authAdmin, json: true, }); - t.ok(result[0].messaging_hook.url === 'http://example2.com/mms' , 'successfully updated messaging_hook'); + t.ok(result.messaging_hook.url === 'http://example2.com/mms' , 'successfully updated messaging_hook'); /* assign phone number to application */ result = await request.put(`/PhoneNumbers/${phone_number_sid}`, { diff --git a/test/auth.js b/test/auth.js index 756cee8..41e8397 100644 --- a/test/auth.js +++ b/test/auth.js @@ -318,7 +318,7 @@ test('authentication tests', async(t) => { json: true }); //console.log(`result: ${JSON.stringify(result)}`); - t.ok(result.length === 1, 'using account token A1 we are able to retrieve application A1'); + t.ok(result.name === "A1-app", 'using account token A1 we are able to retrieve application A1'); /* cannot see app under another account using account token */ result = await request.get(`/Applications/${appA2}`, {