Groups cdr_feed legs by Correlation ID for call-level summaries, fixes report-column field parsing and Docker proxy routing, and adds /calltest post-call Twilio and CDR enrichment. Co-authored-by: Cursor <cursoragent@cursor.com>
51 lines
1.5 KiB
JavaScript
51 lines
1.5 KiB
JavaScript
// tests/webex.reportsClient.test.js
|
|
|
|
import test from 'node:test';
|
|
import assert from 'node:assert/strict';
|
|
|
|
import {
|
|
parseMediaQualityCsv,
|
|
filterMediaQualityRows,
|
|
reportDateRangeFromWindow,
|
|
} from '../integrations/webex/reportsCsv.js';
|
|
|
|
test('parseMediaQualityCsv parses header rows', () => {
|
|
const csv = 'Start Time,Location,MOS\n2026-07-23T14:00:00Z,Store 0782,4.1\n';
|
|
const { headers, rows } = parseMediaQualityCsv(csv);
|
|
assert.equal(headers.length, 3);
|
|
assert.equal(rows.length, 1);
|
|
assert.equal(rows[0].MOS, '4.1');
|
|
});
|
|
|
|
test('filterMediaQualityRows filters by location and window', () => {
|
|
const window = {
|
|
startTime: '2026-07-23T13:00:00.000Z',
|
|
endTime: '2026-07-23T18:00:00.000Z',
|
|
};
|
|
const rows = [
|
|
{
|
|
Location: 'Warrendale - LGW',
|
|
'Start Time': '2026-07-23T14:00:00.000Z',
|
|
_norm: { location: 'warrendale - lgw', starttime: '2026-07-23T14:00:00.000Z' },
|
|
},
|
|
{
|
|
Location: 'Other',
|
|
'Start Time': '2026-07-23T14:00:00.000Z',
|
|
_norm: { location: 'other', starttime: '2026-07-23T14:00:00.000Z' },
|
|
},
|
|
];
|
|
const filtered = filterMediaQualityRows(rows, {
|
|
locationName: 'Warrendale - LGW',
|
|
window,
|
|
});
|
|
assert.equal(filtered.length, 1);
|
|
});
|
|
|
|
test('reportDateRangeFromWindow uses ISO date slice', () => {
|
|
const r = reportDateRangeFromWindow({
|
|
startTime: '2026-07-23T13:00:00.000Z',
|
|
endTime: '2026-07-23T23:00:00.000Z',
|
|
});
|
|
assert.equal(r.startDate, '2026-07-23');
|
|
assert.equal(r.endDate, '2026-07-23');
|
|
});
|