feat(asset-query): 优化固资快照与请假分流能力
This commit is contained in:
1 parent
873331dd20
commit
f9b04eddc8
7 files changed
+59
-17
No files matched your search
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* 用途:覆盖请假强/弱意图边界,避免“咨询规则”被误判成“立即发起请假”。
|
||||
* 依赖:与 leaveIntent.ts 中的 isStrongLeaveIntent 保持一致。
|
||||
* 逻辑:弱咨询句应继续走 Dify;强请假句才触发表单流程。
|
||||
*/
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import { isStrongLeaveIntent } from './leaveIntent';
|
||||
|
||||
describe('isStrongLeaveIntent', () => {
|
||||
it('将非强请假咨询句判定为弱意图', () => {
|
||||
// 断言:规则咨询不应触发本地请假表单,应继续走 Dify 问答。
|
||||
expect(isStrongLeaveIntent('年假可以按照小时请假吗?')).toBe(false);
|
||||
expect(isStrongLeaveIntent('怎么请年假?年假可以按照小时请假吗?')).toBe(false);
|
||||
});
|
||||
|
||||
it('保留强请假意图触发表单', () => {
|
||||
// 断言:明确申请/发起请假的表达仍应保留原有请假流程。
|
||||
expect(isStrongLeaveIntent('我要请假')).toBe(true);
|
||||
expect(isStrongLeaveIntent('帮我请年假')).toBe(true);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user