mirror of
https://github.com/jambonz/jambonz-api-server.git
synced 2026-07-24 04:52:03 +00:00
fix for service provider api
This commit is contained in:
+2
-2
@@ -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}`, {
|
||||
|
||||
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user