test: cover master agent evolution entry wiring
This commit is contained in:
@@ -52,3 +52,21 @@ test("me page exposes master agent evolution entry", async () => {
|
||||
assert.match(source, /href="\/me\/master-agent\/evolution"/, "expected me page to link evolution page");
|
||||
assert.match(source, /title="主 Agent 自动进化"/, "expected me page to show evolution menu title");
|
||||
});
|
||||
|
||||
test("master agent evolution page renders admin-aware dashboard shell", async () => {
|
||||
const pageSource = await readSource("src/app/me/master-agent/evolution/page.tsx");
|
||||
const clientSource = await readSource("src/components/master-agent-evolution-client.tsx");
|
||||
|
||||
assert.match(pageSource, /getMasterAgentEvolutionDashboard/, "expected page to load evolution dashboard server-side");
|
||||
assert.match(pageSource, /session\.role === "highest_admin"/, "expected page to gate admin actions by role");
|
||||
assert.match(pageSource, /<MasterAgentEvolutionClient/, "expected page to render evolution client");
|
||||
assert.match(clientSource, /待处理提案/, "expected dashboard to expose pending proposals");
|
||||
assert.match(clientSource, /最近信号/, "expected dashboard to expose recent signals");
|
||||
assert.match(clientSource, /已生效规则/, "expected dashboard to expose applied rules");
|
||||
assert.match(clientSource, /\/api\/v1\/master-agent\/evolution\/config/, "expected mode switch API to be wired");
|
||||
assert.match(
|
||||
clientSource,
|
||||
/\/api\/v1\/master-agent\/evolution\/proposals\/\$\{proposalId\}\/\$\{action\}/,
|
||||
"expected proposal review API to be wired",
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user