mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-10-28 14:10:37 +00:00
* feat(frontend): support extension providers in composer mentions * fix(mentions): retain settled plugin suggestions during search * fix(extensions): validate identifiers and skip empty mention searches * test: stabilize history pagination after latest page refresh --------- Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
33 lines
1.1 KiB
TypeScript
33 lines
1.1 KiB
TypeScript
import { expect, it } from "@rstest/core";
|
|
|
|
import {
|
|
referenceToken,
|
|
renderReferenceEditor,
|
|
} from "@/components/workspace/mentions/inline-references";
|
|
import { extensionMentionId } from "@/core/extensions/mentions";
|
|
|
|
it("renders plugin references with a distinct glyph and color from conversations", () => {
|
|
const root = document.createElement("div");
|
|
const plugin = referenceToken(
|
|
"extension",
|
|
extensionMentionId({
|
|
namespace: "community.team",
|
|
provider: "people",
|
|
id: "alice",
|
|
label: "Alice",
|
|
}),
|
|
"Alice",
|
|
);
|
|
const conversation = referenceToken("conversation", "thread", "Conversation");
|
|
renderReferenceEditor(root, `${plugin} ${conversation}`);
|
|
const extensionChip = root.querySelector<HTMLElement>(
|
|
'[data-reference-kind="extension"]',
|
|
)!;
|
|
const conversationChip = root.querySelector<HTMLElement>(
|
|
'[data-reference-kind="conversation"]',
|
|
)!;
|
|
expect(extensionChip.firstElementChild?.textContent).toBe("◈");
|
|
expect(conversationChip.firstElementChild?.textContent).toBe("◉");
|
|
expect(extensionChip.className).not.toBe(conversationChip.className);
|
|
});
|