Substitute org name and balance tokens in outbound SMS so templates no longer leave {از طرف} literal.
EOF Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -56,7 +56,19 @@ function testTemplate() {
|
||||
}) === 'سلام علی 0912',
|
||||
'name phone vars',
|
||||
);
|
||||
assert(clipSms('الف'.repeat(200)).length === 200, 'sms is not clipped');
|
||||
assert(
|
||||
applyMessageTemplate('تبریک {از طرف}', { from: 'هنراندیشه' }) ===
|
||||
'تبریک هنراندیشه',
|
||||
'from org var',
|
||||
);
|
||||
assert(
|
||||
applyMessageTemplate('مانده {مانده ریالی} / {مانده فلزی}', {
|
||||
rialBalance: '۱۰۰۰ بس',
|
||||
metalBalance: 'طلا ۲',
|
||||
}) === 'مانده ۱۰۰۰ بس / طلا ۲',
|
||||
'balance vars',
|
||||
);
|
||||
assert(clipSms('ا'.repeat(200)).length === 200, 'sms is not clipped');
|
||||
}
|
||||
|
||||
testDelay();
|
||||
|
||||
Reference in New Issue
Block a user