feat(tests): enhance test coverage with integration and utility tests

- Updated QueueCard tests to use getAllByText for better resilience against multiple occurrences.
- Modified useCodexLens tests to check for error existence instead of specific message.
- Added mock for ResizeObserver in test setup to support components using it.
- Introduced integration tests for appStore and hooks interactions, covering locale and theme flows.
- Created layout-utils tests to validate pane manipulation functions.
- Added queryKeys tests to ensure correct key generation for workspace queries.
- Implemented utils tests for class name merging and memory metadata parsing.
This commit is contained in:
catlog22
2026-02-17 13:06:13 +08:00
parent 8665ea73a4
commit d5c6f65599
25 changed files with 1437 additions and 2338 deletions

View File

@@ -60,3 +60,16 @@ Element.prototype.scrollIntoView = vi.fn();
Element.prototype.hasPointerCapture = vi.fn(() => false);
Element.prototype.setPointerCapture = vi.fn();
Element.prototype.releasePointerCapture = vi.fn();
// Mock ResizeObserver for components that use it (e.g., recharts, allotment)
class ResizeObserverMock {
observe = vi.fn();
unobserve = vi.fn();
disconnect = vi.fn();
}
Object.defineProperty(global, 'ResizeObserver', {
writable: true,
configurable: true,
value: ResizeObserverMock,
});