fix(ui): show reused ROI estimates after sync

Co-Authored-By: Ishaan Jaffer <155045088+ishaan-berri@users.noreply.github.com>
This commit is contained in:
Devin AI 2026-09-29 07:14:41 +00:00
parent a8679be705
commit 8f0d8bbe25
2 changed files with 5 additions and 1 deletions

View file

@ -227,7 +227,7 @@ describe("ROICalculatorView", () => {
stage: "Estimating pull requests",
total: 1,
};
const completedStatus = { ...idleStatus, phase: "complete", done: 1, total: 1 };
const completedStatus = { ...idleStatus, phase: "complete", done: 57, total: 57, reused: 57 };
vi.mocked(apiClient.get)
.mockResolvedValueOnce(settings)
.mockResolvedValueOnce({ report: null })
@ -247,6 +247,7 @@ describe("ROICalculatorView", () => {
expect(await screen.findByText("Spend per estimated engineering hour", {}, { timeout: 5000 })).toBeInTheDocument();
expect(screen.queryByRole("heading", { name: "Connect GitHub to get started" })).not.toBeInTheDocument();
expect(screen.getByRole("status")).toHaveTextContent("Up to date · Last synced Sep 30, 2026, 12:00 PM UTC");
expect(screen.getByRole("status")).toHaveTextContent("57 of 57 estimates reused");
});
it("shows the sync error returned by the status endpoint", async () => {

View file

@ -192,6 +192,9 @@ export default function ROICalculatorView({
{syncedAt && (
<span className="mt-1 block text-xs text-muted-foreground" role="status">
Up to date · Last synced {formatSyncedAt(syncedAt)}
{!status.running && status.phase === "complete" && status.reused > 0
? ` · ${status.reused} of ${status.total} estimates reused`
: ""}
</span>
)}
</>