Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

fix(ci): repair the three Frontend Tests suites #6004 left red

Louis Beaumonta9c2c62c7504
diff --git a/apps/screenpipe-app-tauri/components/chat/standalone/upgrade-quota-banner.test.tsx b/apps/screenpipe-app-tauri/components/chat/standalone/upgrade-quota-banner.test.tsx
index ef492a512..353a94a12 100644
--- a/apps/screenpipe-app-tauri/components/chat/standalone/upgrade-quota-banner.test.tsx
+++ b/apps/screenpipe-app-tauri/components/chat/standalone/upgrade-quota-banner.test.tsx
@@ -358,6 +358,29 @@ describe("UpgradeQuotaBanner", () => {
},
);
+ it("stays generic for a required plan this build predates", async () => {
+ // The gateway can name a plan shipped after this build. Printing the raw
+ // id ("Upgrade to business_titan") invents a plan name, so both the CTA
+ // and the sentence fall back rather than guess.
+ mocks.blockedUpgrade = {
+ requiredPlan: "business_titan" as never,
+ upgradeUrl: "https://screenpipe.com/account/billing",
+ resetsAt: null,
+ };
+
+ render(<UpgradeQuotaBanner />);
+
+ expect(screen.queryByText(/business_titan/i)).toBeNull();
+ expect(screen.getByText(/upgrade to a higher plan/i)).toBeInTheDocument();
+ fireEvent.click(screen.getByRole("button", { name: "See plans" }));
+
+ await waitFor(() =>
+ expect(mocks.openExternalUrl).toHaveBeenCalledWith(
+ "https://screenpipe.com/account/billing",
+ ),
+ );
+ });
+
it("dismisses the blocked action without suppressing future server rejections", () => {
mocks.blockedUpgrade = {
requiredPlan: "business",
diff --git a/apps/screenpipe-app-tauri/components/chat/standalone/upgrade-quota-banner.tsx b/apps/screenpipe-app-tauri/components/chat/standalone/upgrade-quota-banner.tsx
index f18273ac5..f9b6e122e 100644
--- a/apps/screenpipe-app-tauri/components/chat/standalone/upgrade-quota-banner.tsx
+++ b/apps/screenpipe-app-tauri/components/chat/standalone/upgrade-quota-banner.tsx
@@ -191,9 +191,14 @@ export function UpgradeQuotaBanner() {
onClick={onUpgrade}
disabled={busy}
>
+ {/* Name where the click actually goes. With no server upgrade
+ this opens the Business offer, so it says so; only an
+ upgrade to a plan this build cannot name is generic. */}
{requiredPlanLabel
? `Upgrade to ${requiredPlanLabel}`
- : "See plans"}
+ : activeUpgrade
+ ? "See plans"
+ : "View Business"}
</Button>
)}
<button
diff --git a/apps/screenpipe-app-tauri/components/plan-expiration-notice.test.tsx b/apps/screenpipe-app-tauri/components/plan-expiration-notice.test.tsx
index 4928dbbc6..0634465f3 100644
--- a/apps/screenpipe-app-tauri/components/plan-expiration-notice.test.tsx
+++ b/apps/screenpipe-app-tauri/components/plan-expiration-notice.test.tsx
@@ -17,11 +17,23 @@ vi.mock("posthog-js", () => ({
default: { capture: analyticsMocks.capture },
}));
+// The notice reads the build flag so a team/enterprise plan is not called
+// "Business" here while the account section beside it says "Enterprise".
+// useManagedPolicy throws outside the app shell's provider, so stand in for it.
+const policyMocks = vi.hoisted(() => ({ isManagedDeployment: false }));
+
+vi.mock("@/lib/hooks/use-managed-policy", () => ({
+ useManagedPolicy: () => ({
+ isManagedDeployment: policyMocks.isManagedDeployment,
+ }),
+}));
+
describe("PlanExpirationNotice", () => {
afterEach(() => {
cleanup();
vi.clearAllMocks();
vi.useRealTimers();
+ policyMocks.isManagedDeployment = false;
});
it("rounds a partial remaining day up", () => {
@@ -137,4 +149,28 @@ describe("PlanExpirationNotice", () => {
expect(screen.getByText("Basic access ends in 1 day")).toBeInTheDocument();
});
+
+ it.each([
+ ["consumer", false, "Business access ends in 1 day"],
+ ["managed", true, "Enterprise access ends in 1 day"],
+ ])(
+ "names an enterprise plan the same way the account section does (%s build)",
+ (_build, isManagedDeployment, expected) => {
+ vi.useFakeTimers();
+ vi.setSystemTime(new Date("2026-07-21T12:00:00.000Z"));
+ policyMocks.isManagedDeployment = isManagedDeployment;
+
+ render(
+ <PlanExpirationNotice
+ user={{
+ plan_expires_at: "2026-07-22T12:00:00.000Z",
+ subscription_plan: "enterprise",
+ } as AppUser}
+ onClick={vi.fn()}
+ />,
+ );
+
+ expect(screen.getByText(expected)).toBeInTheDocument();
+ },
+ );
});
diff --git a/apps/screenpipe-app-tauri/components/settings/__tests__/account-section.subscription-gate.test.tsx b/apps/screenpipe-app-tauri/components/settings/__tests__/account-section.subscription-gate.test.tsx
index d6fa40321..0220b48b7 100644
--- a/apps/screenpipe-app-tauri/components/settings/__tests__/account-section.subscription-gate.test.tsx
+++ b/apps/screenpipe-app-tauri/components/settings/__tests__/account-section.subscription-gate.test.tsx
@@ -170,13 +170,18 @@ describe("AccountSection subscription/login gating", () => {
const card = screen.getByTestId(ACTIVE_CARD);
expect(card).toBeInTheDocument();
expect(within(card).getByText("active")).toBeInTheDocument();
- expect(within(card).getByText("400 AI credits / month")).toBeInTheDocument();
+ // Scoped to the entitled-features list: the plan grid rendered below it
+ // repeats some of these lines on the Business option.
+ const features = within(card).getByTestId("account-active-plan-features");
+ expect(within(features).getByText("400 AI credits / month")).toBeInTheDocument();
expect(
- within(card).getByText(
+ within(features).getByText(
"frontier Claude + GPT models: Fable, Opus, Sonnet, latest GPT",
),
).toBeInTheDocument();
- expect(within(card).getByText("cloud sync across your devices")).toBeInTheDocument();
+ expect(
+ within(features).getByText("cloud sync across your devices"),
+ ).toBeInTheDocument();
expect(within(card).queryByText(/cloud transcription/i)).not.toBeInTheDocument();
expect(within(card).queryByText(/100x more AI queries/i)).not.toBeInTheDocument();
diff --git a/apps/screenpipe-app-tauri/components/settings/account-section.tsx b/apps/screenpipe-app-tauri/components/settings/account-section.tsx
index 4855f6605..b100898de 100644
--- a/apps/screenpipe-app-tauri/components/settings/account-section.tsx
+++ b/apps/screenpipe-app-tauri/components/settings/account-section.tsx
@@ -522,7 +522,13 @@ export function AccountSection() {
<span className="text-xs bg-primary/10 text-primary px-2 py-0.5 rounded-full font-medium">active</span>
</div>
</div>
- <div className="grid grid-cols-2 gap-2 text-sm text-muted-foreground">
+ {/* What this account already has. The plan grid below repeats some
+ of these lines for the Business option, so keep them separately
+ addressable. */}
+ <div
+ className="grid grid-cols-2 gap-2 text-sm text-muted-foreground"
+ data-testid="account-active-plan-features"
+ >
{BUSINESS_PLAN_FEATURES.map((feature) => (
<div key={feature} className="flex items-start gap-2">
<span aria-hidden="true">✓</span>