mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-13 02:41:50 +08:00
Add end-to-end tests for workspace switching and backend tests for ask_question tool
- Implemented E2E tests for workspace switching functionality, covering scenarios such as switching workspaces, data isolation, language preference maintenance, and UI updates. - Added tests to ensure workspace data is cleared on logout and handles unsaved changes during workspace switches. - Created comprehensive backend tests for the ask_question tool, validating question creation, execution, answer handling, cancellation, and timeout scenarios. - Included edge case tests to ensure robustness against duplicate questions and invalid answers.
This commit is contained in:
@@ -219,6 +219,7 @@ export function useWebSocket(options: UseWebSocketOptions = {}): UseWebSocketRet
|
||||
completeExecution,
|
||||
updateNode,
|
||||
addOutput,
|
||||
addA2UINotification,
|
||||
onMessage,
|
||||
]
|
||||
);
|
||||
@@ -314,7 +315,20 @@ export function useWebSocket(options: UseWebSocketOptions = {}): UseWebSocketRet
|
||||
connect();
|
||||
}
|
||||
|
||||
// Listen for A2UI action events and send via WebSocket
|
||||
const handleA2UIAction = (event: CustomEvent) => {
|
||||
if (wsRef.current?.readyState === WebSocket.OPEN) {
|
||||
wsRef.current.send(JSON.stringify(event.detail));
|
||||
} else {
|
||||
console.warn('[WebSocket] Cannot send A2UI action: not connected');
|
||||
}
|
||||
};
|
||||
|
||||
// Type the event listener properly
|
||||
window.addEventListener('a2ui-action', handleA2UIAction as EventListener);
|
||||
|
||||
return () => {
|
||||
window.removeEventListener('a2ui-action', handleA2UIAction as EventListener);
|
||||
if (reconnectTimeoutRef.current) {
|
||||
clearTimeout(reconnectTimeoutRef.current);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user