fix(fitbit): show the retired card only to an account that had Fitbit

After the Web API turndown every account still saw a Fitbit card that
can no longer connect. The status entry now publishes
retirement.offered: false once the API is gone for an account with no
Fitbit connection, no Fitbit app of its own and no Fitbit data, and the
connections panel leaves the card out. Accounts that had Fitbit keep it
with the retirement notice.
This commit is contained in:
Marc-André Bombeck committed 2026-10-21 15:06:40 +02:00
1 parent bf3830203f
commit b53434daa0
8 files changed
+172 -40

No files matched your search

@@ -181,3 +181,38 @@ describe("ConnectionsPanel — every envelope entry surfaces", () => {
expect(render()).not.toContain('data-testid="integration-fallback-row"');
});
});
describe("ConnectionsPanel — the Fitbit card after the turndown", () => {
const withFitbit = (retirement: Record<string, unknown>) => ({
threshold: 3,
integrations: fullEnvelope().integrations.map((e) =>
e.integration === "fitbit"
? { ...e, connected: false, configured: false, retirement }
: e,
),
});
it("shows no Fitbit card when the server does not offer it", () => {
envelope = withFitbit({
endsOn: "2026-10-30",
ended: true,
successor: "google-health",
offered: false,
});
const html = render();
expect(html).not.toContain('id="fitbit"');
expect(html).not.toContain('data-testid="fitbit-retirement-notice"');
});
it("keeps the card and its notice for an account that had Fitbit", () => {
envelope = withFitbit({
endsOn: "2026-10-30",
ended: true,
successor: "google-health",
offered: true,
});
const html = render();
expect(html).toContain('id="fitbit"');
expect(html).toContain('data-testid="fitbit-retirement-notice"');
});
});