32 lines
1.4 KiB
TypeScript
32 lines
1.4 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
||
import { runAddressDecomposeStage } from "../src/services/address_runtime/decomposeStage";
|
||
|
||
describe("counterparty follow-up over stale inventory frame", () => {
|
||
it("keeps bare pronoun document follow-up on the active counterparty lane", () => {
|
||
const result = runAddressDecomposeStage("а по нему документы?", {
|
||
previous_intent: "list_contracts_by_counterparty",
|
||
target_intent: "list_documents_by_counterparty",
|
||
previous_filters: {
|
||
counterparty: 'ТСЖ "Жуковка 51"',
|
||
organization: "ООО Альтернатива Плюс",
|
||
as_of_date: "2026-04-16"
|
||
},
|
||
previous_anchor_type: "counterparty",
|
||
previous_anchor_value: 'ТСЖ "Жуковка 51"',
|
||
root_intent: "inventory_on_hand_as_of_date",
|
||
root_filters: {
|
||
organization: "ООО Альтернатива Плюс",
|
||
as_of_date: "2026-04-16"
|
||
},
|
||
root_anchor_type: "organization",
|
||
root_anchor_value: "ООО Альтернатива Плюс",
|
||
current_frame_kind: "inventory_root"
|
||
});
|
||
|
||
expect(result).not.toBeNull();
|
||
expect(result?.intent.intent).toBe("list_documents_by_counterparty");
|
||
expect(result?.filters.extracted_filters.counterparty).toBe('ТСЖ "Жуковка 51"');
|
||
expect(result?.baseReasons).not.toContain("intent_adjusted_to_inventory_followup_context");
|
||
});
|
||
});
|