fix for service provider api

This commit is contained in:
Dave Horton
2020-05-29 09:54:26 -04:00
parent 0e248cb393
commit a746bbc4c9
6 changed files with 156 additions and 22 deletions
+2 -2
View File
@@ -45,7 +45,7 @@ test('account tests', async(t) => {
});
let regHook = result[0].registration_hook;
t.ok(result.length === 1 &&
Object.keys(regHook).length == 5, 'successfully queried all accounts');
Object.keys(regHook).length == 4, 'successfully queried all accounts');
/* query one accounts */
result = await request.get(`/Accounts/${sid}`, {
@@ -74,7 +74,7 @@ test('account tests', async(t) => {
json: true,
});
//console.log(`retrieved account after update: ${JSON.stringify(result)}`);
t.ok(Object.keys(result.registration_hook).length === 5, 'successfully removed a hook from account');
t.ok(Object.keys(result.registration_hook).length === 4, 'successfully removed a hook from account');
/* assign phone number to account */
result = await request.put(`/PhoneNumbers/${phone_number_sid}`, {
+6 -3
View File
@@ -44,7 +44,10 @@ test('service provider tests', async(t) => {
json: true,
body: {
name: 'johndoe',
root_domain: 'example.com'
root_domain: 'example.com',
registration_hook: {
url: 'http://a.com'
}
}
});
t.ok(result.statusCode === 201, 'successfully created service provider with a root domain');
@@ -85,11 +88,11 @@ test('service provider tests', async(t) => {
t.ok(result.length === 2 , 'successfully queried all service providers');
/* query one service providers */
result = await request.get(`/ServiceProviders/${sid}`, {
result = await request.get(`/ServiceProviders/${sid2}`, {
auth: authAdmin,
json: true,
});
t.ok(result.name === 'daveh' && result.ms_teams_fqdn === 'contoso.com', 'successfully retrieved service provider by sid');
t.ok(result.name === 'johndoe' && result.root_domain === 'example.com', 'successfully retrieved service provider by sid');
/* update service providers */