The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
test(ContextUsage): wrap late failure in act and add assertion
Steven Enamakel0d10a290ed0f
diff --git a/app/src/features/conversations/aui/ContextUsage.test.tsx b/app/src/features/conversations/aui/ContextUsage.test.tsxindex e3c28d336a..6b4155b0a6 100644--- a/app/src/features/conversations/aui/ContextUsage.test.tsx+++ b/app/src/features/conversations/aui/ContextUsage.test.tsx@@ -1,5 +1,5 @@import { combineReducers, configureStore } from '@reduxjs/toolkit';-import { render, screen, waitFor } from '@testing-library/react';+import { act, render, screen, waitFor } from '@testing-library/react';import userEvent from '@testing-library/user-event';import { Provider } from 'react-redux';import { beforeEach, describe, expect, it, vi } from 'vitest';@@ -138,8 +138,8 @@ describe('ContextUsage', () => {const popover = await screen.findByTestId('composer-token-breakdown');await waitFor(() => expect(popover).toHaveTextContent('Tools'));- failFirst(new Error('late failure'));- await Promise.resolve();+ expect(mockCall).toHaveBeenCalledTimes(2);+ await act(async () => failFirst(new Error('late failure')));expect(popover).toHaveTextContent('Tools');expect(popover).not.toHaveTextContent('Context breakdown unavailable');