Files
thu-maic--openmaic/tests/edit/agent-panel-visibility.test.ts
wehub-resource-sync c48612c494
CI / E2E Tests (push) Has been cancelled
CI / Lint, Typecheck & Unit Tests (push) Has been cancelled
Docs Build / Build docs site (push) Has been cancelled
Publish @openmaic packages / Build, validate & publish (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:03:23 +08:00

29 lines
1022 B
TypeScript

import { describe, expect, it } from 'vitest';
import { shouldRenderAgentPanel } from '@/components/edit/agent-panel-visibility';
describe('shouldRenderAgentPanel', () => {
it('renders on scenes that support AI editing', () => {
expect(
shouldRenderAgentPanel({ agentEnabled: true, hasMessages: false, isRunning: false }),
).toBe(true);
});
it('keeps the panel visible on unsupported scenes while a run is active', () => {
expect(
shouldRenderAgentPanel({ agentEnabled: false, hasMessages: false, isRunning: true }),
).toBe(true);
});
it('keeps the panel visible on unsupported scenes when there is conversation history', () => {
expect(
shouldRenderAgentPanel({ agentEnabled: false, hasMessages: true, isRunning: false }),
).toBe(true);
});
it('hides the panel on unsupported scenes with no active or restored thread', () => {
expect(
shouldRenderAgentPanel({ agentEnabled: false, hasMessages: false, isRunning: false }),
).toBe(false);
});
});