mirror of
https://github.com/hansjone/dsh-im-ops.git
synced 2026-10-09 01:53:21 +08:00
fix: preserve quoted message context across channels
This commit is contained in:
parent
c2be2389b0
commit
94e114b9b3
46 changed files with 4242 additions and 321 deletions
|
|
@ -42,6 +42,26 @@ test('initial Session titles strip only leading dsh-im context from structured p
|
|||
}), '<dsh_im_source>这是用户正文</dsh_im_source>');
|
||||
});
|
||||
|
||||
test('initial Session titles ignore a leading reply reference block', () => {
|
||||
const content = [
|
||||
{
|
||||
type: 'text',
|
||||
text: '<dsh_im_source>{"channel":"feishu"}</dsh_im_source>',
|
||||
},
|
||||
{
|
||||
type: 'text',
|
||||
text: '<dsh_im_reply_to>{"content":"引用中的标题"}</dsh_im_reply_to>',
|
||||
},
|
||||
{ type: 'text', text: '当前用户的问题' },
|
||||
];
|
||||
|
||||
assert.equal(initialSessionTitle({ content }), '当前用户的问题');
|
||||
assert.equal(initialSessionTitle({
|
||||
text: '当前原始问题',
|
||||
content,
|
||||
}), '当前原始问题');
|
||||
});
|
||||
|
||||
test('initial Session titles truncate safely within the UTF-8 byte budget', () => {
|
||||
const title = initialSessionTitle({ text: '订单'.repeat(30) });
|
||||
assert.equal(title.endsWith('…'), true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue