Allow enabling/disabling individual SMS template types from dashboard with sync to notification settings
This commit is contained in:
@@ -92,4 +92,27 @@ describe('SMS template variables', () => {
|
||||
assert.ok(slots.includes(slot), `sessionHolding is missing slot ${slot}`);
|
||||
}
|
||||
});
|
||||
|
||||
it('normalizes and merges enabled property for SMS templates', () => {
|
||||
const stored = normalizeStoredEntry({
|
||||
enabled: false,
|
||||
templateId: '123',
|
||||
variables: threeInvoiceVars
|
||||
}, invoiceDef);
|
||||
assert.equal(stored.enabled, false);
|
||||
|
||||
const mergedToTrue = mergeTemplateEntry(
|
||||
invoiceDef,
|
||||
stored,
|
||||
{ enabled: true }
|
||||
);
|
||||
assert.equal(mergedToTrue.enabled, true);
|
||||
|
||||
const mergedToFalse = mergeTemplateEntry(
|
||||
invoiceDef,
|
||||
mergedToTrue,
|
||||
{ enabled: false }
|
||||
);
|
||||
assert.equal(mergedToFalse.enabled, false);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user