Test: Add comprehensive tests for useToolScheduler hook
- Introduces a suite of tests for the hook, covering various scenarios including: - Successful tool execution - Tool not found errors - Errors during - Errors during tool execution - Tool confirmation (approved and cancelled) - (currently skipped) - Live output updates - (currently skipped) - Cancellation of tool calls (before execution and during approval) - (currently skipped) - Execution of multiple tool calls - Preventing scheduling while other calls are running - (currently skipped) - Includes tests for the utility function to ensure correct mapping of tool call states to display objects. - Mocks dependencies like , , and individual instances. - Uses fake timers to control asynchronous operations. Note: Some tests involving complex asynchronous interactions (confirmations, live output, cancellations) are currently skipped due to challenges in reliably testing these scenarios with the current setup. These will be addressed in future work.
This commit is contained in:
parent
ae8e2106bb
commit
1a84d8f674