Add store/email/phone filtering, richer call-line formatting, CDR feed pagination and queueing, and split Jira poller enrichment into testable modules. Co-authored-by: Cursor <cursoragent@cursor.com>
22 lines
841 B
JavaScript
22 lines
841 B
JavaScript
// tests/jiraPoller.runEnrichment.test.js
|
|
|
|
import test from 'node:test';
|
|
import assert from 'node:assert/strict';
|
|
|
|
import { formatEnrichmentBody } from '../services/jiraPoller/formatBody.js';
|
|
import { CHECK_IDS } from '../services/jiraPoller/enrichmentRules.js';
|
|
|
|
test('formatEnrichmentBody merges sections with headings', () => {
|
|
const body = formatEnrichmentBody([
|
|
{ title: 'Phone status', markdown: '**Phones OK**' },
|
|
{ title: 'Call report (today)', markdown: '**Calls: 5**' },
|
|
]);
|
|
assert.match(body, /## Phone status\n\n\*\*Phones OK\*\*/);
|
|
assert.match(body, /## Call report \(today\)\n\n\*\*Calls: 5\*\*/);
|
|
});
|
|
|
|
test('CHECK_IDS covers expected checks', () => {
|
|
assert.equal(CHECK_IDS.phonestatus, 'phonestatus');
|
|
assert.equal(CHECK_IDS.callreport, 'callreport');
|
|
assert.equal(CHECK_IDS.avstatus, 'avstatus');
|
|
});
|