fix: hide agent file attachments for A-Copilot

This commit is contained in:
2026-10-19 14:50:08 +09:00
parent 7cfd466350
commit af21fa0510
3 changed files with 22 additions and 1 deletions
+17
View File
@@ -64,6 +64,23 @@ function setup(overrides = {}, browser = {}) {
}
}
for (const agentProvider of ['A_COPILOT', 'QWEN', 'OPENAI', 'ANTHROPIC', 'GEMINI']) {
for (const qaMode of ['ai', 'agent', 'teacher']) {
test(`attachment controls follow the provider and chat mode (${agentProvider}, ${qaMode})`, () => {
const harness = setup({ qaMode, agentProvider })
const input = elements(harness.render(), node => node.type === QaInputBox)[0]
assert.equal(input.props.attachmentsEnabled, qaMode === 'agent' && agentProvider !== 'A_COPILOT')
assert.equal(typeof input.props.onClearConversation, 'function')
})
}
}
test('the workspace passes the current provider from agent status to the chat panel', () => {
const source = fs.readFileSync(require.resolve('../src/renderer/src/App.tsx'), 'utf8')
assert.match(source, /provider: agentProvider,[\s\S]*?\} = useAiAgent\(/)
assert.match(source, /<WorkspaceQaPanel[\s\S]*?agentProvider=\{agentProvider\}/)
})
for (const qaMode of ['ai', 'agent', 'teacher']) {
test(`${qaMode} history is deleted only after shared modal confirmation`, () => {
const harness = setup({ qaMode, agentMessages: [{ id: 'a', content: 'answer' }], visibleTeacherMessages: [{ id: 't', content: 'answer' }] })