Bring the checks up to date with the trend and range changes
The checks had fallen behind three refactors and had stopped running: foodTrend became dailyTrend (the sleep trend line), the sleep average moved into averageDays, and the custom date range replaced chartDays with chartRange/chartSpan and gave the sentences a window phrase. They now load the current functions. The window check exercises the real range picker against stored settings, with a new case for a custom range in the past. No assertion changed meaning; all 223 pass.
This commit is contained in:
1 parent
7b1b0889c6
commit
a37474ab82
3 files changed
+57
-31
No files matched your search
@@ -13,12 +13,15 @@ let excluded = new Set();
|
||||
let windowDays = 7;
|
||||
|
||||
const curves = load({
|
||||
names: ["startOfDay", "pairWindows", "sleepWindows", "sleepTrendCurves"],
|
||||
names: ["startOfDay", "addDays", "pairWindows", "sleepWindows", "averageDays", "sleepTrendCurves"],
|
||||
stubs: {
|
||||
selectedDay: () => SEL,
|
||||
ymd: (d) => `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, "0")}-${String(d.getDate()).padStart(2, "0")}`,
|
||||
isExcluded: (d) => excluded.has(d.getDate()),
|
||||
chartDays: () => windowDays,
|
||||
// A preset window: the average runs over the N full days before the
|
||||
// selected one (averageDays). A custom range isn't what's checked here.
|
||||
chartRange: () => ({ custom: false, days: windowDays }),
|
||||
chartDayList: () => [],
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user