Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

test(plan-review): seed store with pending review before render

Steven Enamakeld10f5aba5840
diff --git a/app/src/features/conversations/aui/PlanReviewPart.test.tsx b/app/src/features/conversations/aui/PlanReviewPart.test.tsx
index 87bd4daa3b..ec08b9b04e 100644
--- a/app/src/features/conversations/aui/PlanReviewPart.test.tsx
+++ b/app/src/features/conversations/aui/PlanReviewPart.test.tsx
@@ -5,7 +5,10 @@ import { Provider } from 'react-redux';
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { callCoreRpc } from '../../../services/coreRpcClient';
-import chatRuntimeReducer, { type PendingPlanReview } from '../../../store/chatRuntimeSlice';
+import chatRuntimeReducer, {
+ type PendingPlanReview,
+ setPendingPlanReviewForThread,
+} from '../../../store/chatRuntimeSlice';
import threadTodosReducer from '../../../store/threadTodosSlice';
import { PlanReviewCardCore } from './PlanReviewPart';
@@ -21,6 +24,9 @@ function renderCard(review: PendingPlanReview = REVIEW) {
const store = configureStore({
reducer: combineReducers({ chatRuntime: chatRuntimeReducer, threadTodos: threadTodosReducer }),
});
+ // Seed the store the way `ChatRuntimeProvider` would on `plan_review_request`
+ // — `decide()`'s optimistic clear needs something to clear.
+ store.dispatch(setPendingPlanReviewForThread({ threadId: 't1', review }));
render(
<Provider store={store}>
<PlanReviewCardCore threadId="t1" review={review} />