* #361

* fix typo in db upgrade script

---------

Co-authored-by: Hoan Luu Huu <110280845+xquanluu@users.noreply.github.com>
This commit is contained in:
Dave Horton
2024-11-26 20:25:25 -05:00
committed by GitHub
parent f9990da468
commit 843980c7f6
6 changed files with 43 additions and 15 deletions

View File

@@ -24,16 +24,24 @@ function makeSynthKey({account_sid = '', vendor, language, voice, engine = '', t
test('tts-cache', async(t) => {
const app = require('../app');
try {
// clear cache to start
let result = await request.delete('/TtsCache', {
auth: authAdmin,
resolveWithFullResponse: true,
});
t.ok(result.statusCode === 204, 'successfully purged cache for start of test');
// create caches
const minRecords = 8;
for (const i in Array(minRecords).fill(0)) {
await client.set(makeSynthKey({vendor: i, language: i, voice: i, engine: i, text: i}), i);
}
let result = await request.get('/TtsCache', {
result = await request.get('/TtsCache', {
auth: authAdmin,
json: true,
});
//console.log(result);
t.ok(result.size === minRecords, 'get cache correctly');
@@ -41,7 +49,7 @@ test('tts-cache', async(t) => {
auth: authAdmin,
resolveWithFullResponse: true,
});
t.ok(result.statusCode === 204, 'successfully deleted application after removing phone number');
t.ok(result.statusCode === 204, 'successfully purged cache');
result = await request.get('/TtsCache', {
auth: authAdmin,

View File

@@ -207,7 +207,8 @@ test('voip carrier tests', async(t) => {
json: true,
body: {
name: 'twilio',
e164_leading_plus: true
e164_leading_plus: true,
dtmf_type: 'tones'
}
});
t.ok(result.statusCode === 201, 'successfully created voip carrier for a service provider');
@@ -221,6 +222,7 @@ test('voip carrier tests', async(t) => {
});
//console.log(result.body);
t.ok(result.statusCode === 200, 'successfully retrieved voip carrier for a service provider');
//console.log(result.body);
sid = result.body[0].voip_carrier_sid;
await deleteObjectBySid(request, '/VoipCarriers', sid);