8e6b3abac3
- PluginManager: 采用上游 useMarketPlugins(300行: 分页append/loadingMore/autoLoadBlocked/竞态AbortController/highlightFilter) + MarketPluginList(无限滚动LoadMoreSentinel+PluginViewToggle卡片/列表切换); OfficialPluginList.module.less 保留三处 var(--color-border) 定制+追加上游移动端@media; index.module.less 三向并合; 本地 index.tsx 保留(operator 权限 gate) - Market: MarketPanel(新 install: MarketInstallController 接口)/useMarketInstall/useMarketSearch/SkillIcon/ResultCard 采用上游 - Channels: ChannelDrawer/channelConfig/constants 上游版; 定制点保留(channelIcons console=var(--color-primary)、PendingApprovalsDrawer var(--color-success)) - api/types/chat.ts 采用上游(ChatGroup/ChatSource/ChatGroupKind/group_id); pages/Agent/Skills/index.tsx 适配 useMarketInstall - utils: chatGroups.ts + 14 个上游缺失工具测试补齐; CronJobs 测试补齐 - 测试修复: design-mock 补 Tabs 桩(上游 PluginViewToggle 依赖); MarketPluginList.test 采用上游版; skill.test 品牌映射云超服; lazyWithRetry.test 适配本地 dev-server 回退 - 验证: tsc 0 错误、build 通过、阶段 4 相关 45 测试文件 427 用例全过
36 lines
999 B
TypeScript
36 lines
999 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import type { InboxEvent } from "../api/modules/console";
|
|
import { INBOX_EVENT_QUERY_LIMIT, isPushMessageEvent } from "./inboxEvents";
|
|
|
|
function event(sourceType: string): InboxEvent {
|
|
return {
|
|
id: sourceType,
|
|
agent_id: "default",
|
|
source_type: sourceType,
|
|
source_id: "source",
|
|
event_type: "test",
|
|
status: "success",
|
|
severity: "info",
|
|
title: "Test",
|
|
body: "Test",
|
|
read: false,
|
|
created_at: 1,
|
|
};
|
|
}
|
|
|
|
describe("inboxEvents", () => {
|
|
it("uses the shared page size for inbox counters", () => {
|
|
expect(INBOX_EVENT_QUERY_LIMIT).toBe(200);
|
|
});
|
|
|
|
it("matches the push-message sources shown by the Inbox", () => {
|
|
expect(
|
|
["cron", "heartbeat", "memory", "skill_autoupdate"].every((source) =>
|
|
isPushMessageEvent(event(source)),
|
|
),
|
|
).toBe(true);
|
|
expect(isPushMessageEvent(event("approval"))).toBe(false);
|
|
expect(isPushMessageEvent(event("manual"))).toBe(false);
|
|
});
|
|
});
|