{
+ testState.useUsage.mockReturnValue({
+ merged: {
+ ...mergeUsage([], USAGE_CONTRACT_VERSION),
+ incompleteSources: [
+ {
+ environmentId: "env-a",
+ environmentLabel: "Local",
+ provider: "mcode",
+ status: "failed",
+ message: "1 usage file could not be read.",
+ },
+ ],
+ },
+ environments: [],
+ isPending: false,
+ isPartial: false,
+ refresh: vi.fn(),
+ });
+
+ expect(renderToStaticMarkup()).toContain(
+ "Local's MCode usage could not be read.",
+ );
+ });
+
+ it("spans the empty time table across every provider column", () => {
+ testState.useUsage.mockReturnValue({
+ merged: mergeUsage([], USAGE_CONTRACT_VERSION),
+ environments: [],
+ isPending: false,
+ isPartial: false,
+ refresh: vi.fn(),
+ });
+
+ expect(renderToStaticMarkup()).toMatch(
+ /| No activity in this window\.<\/td>/,
+ );
+ });
});
diff --git a/apps/web/src/components/usage/UsagePage.tsx b/apps/web/src/components/usage/UsagePage.tsx
index 3c99271c1b2b..ddf758e521ae 100644
--- a/apps/web/src/components/usage/UsagePage.tsx
+++ b/apps/web/src/components/usage/UsagePage.tsx
@@ -2,7 +2,7 @@ import type { UsageProviderKind } from "@t3tools/contracts";
import { CheckIcon, RefreshCwIcon, XIcon } from "lucide-react";
import { useMemo, useState } from "react";
-import type { DailyTotals, HourlyTotals } from "@t3tools/shared/usageMerge";
+import type { DailyTotals, HourlyTotals, MergedUsage } from "@t3tools/shared/usageMerge";
import { isElectron } from "../../env";
import { cn } from "../../lib/utils";
@@ -207,6 +207,7 @@ export function UsagePage() {
@@ -390,7 +391,10 @@ export function UsagePage() {
|