test(integrations): expect six integration pills and drop unused field maps

The mobile settings test asserted three integration pills; Polar, Oura and
Nightscout bring the list to six. Remove the unused Oura and Polar field-map
documentation constants and the unused advanced-indices interface the dead-code
gate flagged.
This commit is contained in:
Marc-André Bombeck committed 2026-06-14 21:46:20 +02:00
1 parent 3f5b1a66a1
commit 1d3ee1d93c
4 files changed
+1 -96

No files matched your search

+1 -2
View File
@@ -143,9 +143,8 @@ test.describe("/settings/integrations Pixel-5 layout", () => {
// Wait for the pills to mount (queries resolve after first paint).
const pills = page.locator('[data-testid="integration-status-pill"]');
// Three integration cards now (Withings, WHOOP, Google Health) → three
// pills.
await expect(pills).toHaveCount(3, { timeout: 10_000 });
await expect(pills).toHaveCount(6, { timeout: 10_000 });
// Withings is connected in this fixture; WHOOP is a BYO-keys card that
// stays dormant until an operator adds credentials, so assert the one
-34
View File
@@ -146,40 +146,6 @@ export interface TimeInRangeDistribution {
};
}
/**
* Advanced glycaemic indices — the "advanced" disclosure tier of the panel.
* Each is a single scalar over the in-window readings; all are derivable from
* spot samples (unlike the dense-stream MAGE/CONGA/MODD family this module
* deliberately defers). Surfaced behind a progressive disclosure because they
* read as research-grade composites a casual user does not need up front.
*/
export interface GlucoseAdvancedIndices {
/**
* J-index — a single number folding central tendency AND variability:
* J = 0.001 × (mean + SD)², mean & SD in mg/dL.
* Reference bands (Wojcicki 1995): ~10–20 ideal/non-diabetic,
* 20–30 good control, 30–40 fair, > 40 poor. Reported here as an estimate
* over spot data, not a continuous-trace J.
* Wojcicki 1995, Horm Metab Res 27(1):41-42, DOI 10.1055/s-2007-979906.
*/
jIndex: number;
/**
* Low Blood Glucose Index — Kovatchev hypoglycaemia risk. Mean of the
* left-branch risk values `rl(BG)` over all readings; higher = more / deeper
* lows. Interpretation bands (Kovatchev 2006): < 1.1 minimal, 1.1–2.5 low,
* 2.5–5 moderate, > 5 high hypo risk.
* Kovatchev 2006, Diabetes Care 29(11):2433-2438, DOI 10.2337/dc06-1085.
*/
lbgi: number;
/**
* High Blood Glucose Index — Kovatchev hyperglycaemia risk. Mean of the
* right-branch risk values `rh(BG)`; higher = more / higher highs.
* Interpretation bands (Kovatchev 2006): < 4.5 low, 4.5–9 moderate,
* > 9 high hyper risk.
* Kovatchev 2006, Diabetes Care 29(11):2433-2438, DOI 10.2337/dc06-1085.
*/
hbgi: number;
}
/** Variability summary: SD + CV% with the Monnier stability flag. */
export interface GlucoseVariability {
-29
View File
@@ -401,32 +401,3 @@ export function mapDailyActivity(a: OuraDailyActivity): MappedMeasurement[] {
return out;
}
export const OURA_FIELD_MAP: Record<
string,
{ type: string; unit: string; note?: string }
> = {
"daily_readiness.score": {
type: "RECOVERY_SCORE",
unit: "score",
note: "0-100 readiness; feeds recovery ladder below WHOOP",
},
"sleep.{light,deep,rem}_sleep_duration": {
type: "SLEEP_DURATION",
unit: "minutes",
note: "s->min, one row per stage",
},
"sleep.awake_time": {
type: "SLEEP_DURATION",
unit: "minutes",
note: "AWAKE stage",
},
"sleep.efficiency": { type: "SLEEP_EFFICIENCY", unit: "%" },
"sleep.average_hrv": { type: "HRV_RMSSD", unit: "ms" },
"sleep.lowest_heart_rate": { type: "RESTING_HEART_RATE", unit: "bpm" },
"sleep.average_breath": { type: "RESPIRATORY_RATE", unit: "breaths/min" },
"daily_activity.steps": { type: "ACTIVITY_STEPS", unit: "steps" },
"daily_activity.active_calories": {
type: "ACTIVE_ENERGY_BURNED",
unit: "kcal",
},
};
-31
View File
@@ -432,34 +432,3 @@ export function mapActivity(a: PolarActivity): MappedMeasurement[] {
}
/** Field→Measurement reference table (mirror of the mappers above). */
export const POLAR_FIELD_MAP: Record<
string,
{ type: string; unit: string; note?: string }
> = {
"nightly_recharge.nightly_recharge_status": {
type: "RECOVERY_SCORE",
unit: "score",
note: "1-6 band rescaled to 0-100; feeds recovery ladder below WHOOP",
},
"nightly_recharge.hrv_avg": { type: "HRV_RMSSD", unit: "ms" },
"nightly_recharge.heart_rate_avg": {
type: "RESTING_HEART_RATE",
unit: "bpm",
},
"nightly_recharge.breathing_rate_avg": {
type: "RESPIRATORY_RATE",
unit: "breaths/min",
},
"sleep.{light,deep,rem}_sleep": {
type: "SLEEP_DURATION",
unit: "minutes",
note: "s->min, one row per stage (light->CORE, deep->DEEP, rem->REM)",
},
"sleep.sleep_score": { type: "SLEEP_PERFORMANCE", unit: "%" },
"activity.active-steps": { type: "ACTIVITY_STEPS", unit: "steps" },
"activity.active-calories": {
type: "ACTIVE_ENERGY_BURNED",
unit: "kcal",
note: "active portion only (NOT total calories incl. BMR)",
},
};