fix(test): update plugin tests to use getAgentListDisplayName for agent assertions
- Update plugin-interface.test.ts expectations to use getAgentListDisplayName
- Update chat-message.test.ts expectations for agent display names
- Add smoke test for quoted plan name resolution in chat-message.test.ts
- Aligns test expectations with proper agent name formatting
🤖 Generated with OhMyOpenCode assistance
This commit is contained in:
@@ -165,7 +165,7 @@ describe("createPluginInterface - command.execute.before", () => {
|
||||
)
|
||||
|
||||
// then
|
||||
expect(output.message.agent).toBe("atlas")
|
||||
expect(output.message.agent).toBe(getAgentListDisplayName("atlas"))
|
||||
expect(getSessionAgent("ses-command-atlas")).toBe("atlas")
|
||||
expect(readBoulderState(testDir)?.agent).toBe("atlas")
|
||||
})
|
||||
|
||||
@@ -87,13 +87,41 @@ describe("createChatMessageHandler - /start-work integration", () => {
|
||||
await handler(input, output)
|
||||
|
||||
// then
|
||||
expect(output.message["agent"]).toBe("sisyphus")
|
||||
expect(output.message["agent"]).toBe("Sisyphus - Ultraworker")
|
||||
expect(output.parts[0].text).toContain("<auto-slash-command>")
|
||||
expect(output.parts[0].text).toContain("Auto-Selected Plan")
|
||||
expect(output.parts[0].text).toContain("boulder.json has been created")
|
||||
expect(getSessionAgent("test-session")).toBe("sisyphus")
|
||||
expect(readBoulderState(testDir)?.agent).toBe("sisyphus")
|
||||
})
|
||||
|
||||
test("smoke: resolves quoted human-readable plan names through the full /start-work chat.message path", async () => {
|
||||
// given
|
||||
writeFileSync(join(testDir, ".sisyphus", "plans", "my-feature-plan.md"), "# Plan\n- [ ] Task 1")
|
||||
updateSessionAgent("test-session", "prometheus")
|
||||
const args = createMockHandlerArgs()
|
||||
args.hooks.autoSlashCommand = createAutoSlashCommandHook({ skills: [] })
|
||||
args.hooks.startWork = createStartWorkHook({
|
||||
directory: testDir,
|
||||
client: { tui: { showToast: async () => {} } },
|
||||
} as never)
|
||||
const handler = createChatMessageHandler(args)
|
||||
const input = createMockInput("prometheus")
|
||||
const output: ChatMessageHandlerOutput = {
|
||||
message: {},
|
||||
parts: [{ type: "text", text: "/start-work \"my feature plan\"" }],
|
||||
}
|
||||
|
||||
// when
|
||||
await handler(input, output)
|
||||
|
||||
// then
|
||||
expect(output.message["agent"]).toBe("Sisyphus - Ultraworker")
|
||||
expect(output.parts[0].text).toContain("<auto-slash-command>")
|
||||
expect(output.parts[0].text).toContain("Auto-Selected Plan")
|
||||
expect(output.parts[0].text).toContain("my-feature-plan")
|
||||
expect(readBoulderState(testDir)?.plan_name).toBe("my-feature-plan")
|
||||
})
|
||||
})
|
||||
|
||||
describe("createChatMessageHandler - /ulw-loop raw slash fallback", () => {
|
||||
|
||||
Reference in New Issue
Block a user