beadboard/tests/components/unified-shell.test.tsx
zenchantlive c246ceaf21 feat(ux): consolidate Launch Swarm + telemetry UX with minimized strip
- Removed broken LaunchSwarmDialog (formula-based) from TopBar/LeftPanel
- All Rocket buttons (TopBar, LeftPanel, DAG nodes, social cards) now open
  AssignmentPanel (archetype-based) which actually works
- Every Rocket clears taskId first so assignMode && !taskId condition passes
- Conversation button priority: taskId always shows conversation, not assign panel
- Added TelemetryStrip: minimized right sidebar with status dots when non-telemetry
  panel (conversation/assignment) is active
- Live feed has minimize button → restores last taskId or assignMode
- DAG nodes: Signal icon → restores telemetry feed
- Social button on DAG nodes: single router.push to avoid race (setView + setTaskId)
- Fixed social card message button: opens right panel with drawer:closed (no popup)

Co-Authored-By: Oz <oz-agent@warp.dev>
2026-03-01 18:17:58 -08:00

66 lines
3.8 KiB
TypeScript

import test from 'node:test';
import assert from 'node:assert/strict';
import fs from 'fs/promises';
import path from 'path';
// Test that the UnifiedShell component exists and exports correctly
test('UnifiedShell - file exists and exports', async () => {
const fileContent = await fs.readFile(path.join(process.cwd(), 'src/components/shared/unified-shell.tsx'), 'utf-8');
assert.ok(fileContent.includes('export function UnifiedShell'), 'Should export UnifiedShell function');
assert.ok(fileContent.includes('export interface UnifiedShellProps'), 'Should export UnifiedShellProps interface');
});
// Test that UnifiedShell has assignMode state
test('UnifiedShell - has assignMode state', async () => {
const fileContent = await fs.readFile(path.join(process.cwd(), 'src/components/shared/unified-shell.tsx'), 'utf-8');
assert.ok(fileContent.includes('assignMode'), 'Should have assignMode state');
});
// Test that UnifiedShell has selectedAssignIssue state
test('UnifiedShell - has selectedAssignIssue state', async () => {
const fileContent = await fs.readFile(path.join(process.cwd(), 'src/components/shared/unified-shell.tsx'), 'utf-8');
assert.ok(fileContent.includes('selectedAssignIssue'), 'Should have selectedAssignIssue state');
});
// Test that SmartDag receives onAssignModeChange callback
test('UnifiedShell - passes onAssignModeChange to SmartDag', async () => {
const fileContent = await fs.readFile(path.join(process.cwd(), 'src/components/shared/unified-shell.tsx'), 'utf-8');
assert.ok(fileContent.includes('onAssignModeChange'), 'Should pass onAssignModeChange to SmartDag');
});
// Test that SmartDag receives onSelectedIssueChange callback
test('UnifiedShell - passes onSelectedIssueChange to SmartDag', async () => {
const fileContent = await fs.readFile(path.join(process.cwd(), 'src/components/shared/unified-shell.tsx'), 'utf-8');
assert.ok(fileContent.includes('onSelectedIssueChange'), 'Should pass onSelectedIssueChange to SmartDag');
});
// Test that AssignmentPanel is imported
test('UnifiedShell - imports AssignmentPanel', async () => {
const fileContent = await fs.readFile(path.join(process.cwd(), 'src/components/shared/unified-shell.tsx'), 'utf-8');
assert.ok(fileContent.includes('AssignmentPanel'), 'Should import AssignmentPanel');
});
test('UnifiedShell - checks bd health and renders setup warning', async () => {
const fileContent = await fs.readFile(path.join(process.cwd(), 'src/components/shared/unified-shell.tsx'), 'utf-8');
assert.ok(fileContent.includes('useBdHealth'), 'Should use bd health hook');
assert.ok(fileContent.includes('BD setup issue:'), 'Should show bd setup warning text');
});
// Test that AssignmentPanel is rendered conditionally based on view and assignMode
test('UnifiedShell - renders AssignmentPanel conditionally', async () => {
const fileContent = await fs.readFile(path.join(process.cwd(), 'src/components/shared/unified-shell.tsx'), 'utf-8');
// Check for the condition: view === 'graph' && assignMode
assert.ok(fileContent.includes("view === 'graph' && assignMode"), 'Should check view === graph && assignMode condition for AssignmentPanel');
});
// Test that SwarmWorkspace import is removed (deprecated)
test('UnifiedShell - does not import SwarmWorkspace', async () => {
const fileContent = await fs.readFile(path.join(process.cwd(), 'src/components/shared/unified-shell.tsx'), 'utf-8');
assert.ok(!fileContent.includes('SwarmWorkspace'), 'Should NOT import SwarmWorkspace (deprecated)');
});
// Test that SwarmMissionPicker import is removed (deprecated)
test('UnifiedShell - does not import SwarmMissionPicker', async () => {
const fileContent = await fs.readFile(path.join(process.cwd(), 'src/components/shared/unified-shell.tsx'), 'utf-8');
assert.ok(!fileContent.includes('SwarmMissionPicker'), 'Should NOT import SwarmMissionPicker (deprecated)');
});