To-do report: активных дней за последние 7 рядом с активностью за день снимка; подпись над столбиком не обрезается
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -109,7 +109,7 @@ const fakeRepo = (over: Partial<ReportsRepo> = {}): ReportsRepo => ({
|
||||
listSnapshotDays: async () => [{ day: "2026-10-14", snapshotTs: "2026-10-14T15:40:00.000Z" }, { day: "2026-10-13", snapshotTs: "2026-10-13T15:40:00.000Z" }],
|
||||
todoReport: async () => [{ employee_name: "Greg Paris", task_count: 2, stale_days: 5 }, { employee_name: "Alena Danylova", task_count: 1, stale_days: 1 }],
|
||||
todoSource: async () => source,
|
||||
activityByUser: async () => new Map([["Greg Paris", { total: 4, dailyLogs: 1 }]]),
|
||||
activityByUserDays: async () => new Map([["Greg Paris", new Map([["2026-10-14", { total: 4, dailyLogs: 1 }], ["2026-10-13", { total: 1, dailyLogs: 0 }], ["2026-10-09", { total: 2, dailyLogs: 0 }]])]]),
|
||||
...over,
|
||||
});
|
||||
const mk = (repo = fakeRepo(), threshold = 1) => buildApi({ repo, threshold, defaultDays: 30, tz: "America/New_York", now: () => new Date("2026-10-15T14:00:00Z") });
|
||||
@@ -163,6 +163,8 @@ describe("страница To-do report", () => {
|
||||
expect(r.body).toContain("Greg Paris");
|
||||
expect(r.body).toContain('<span class="badge yes">активен</span>');
|
||||
expect(r.body).toContain('<span class="badge no">нет активности</span>'); // у Alena активности нет
|
||||
expect(r.body).toContain("Активных дней за последние 7");
|
||||
expect(r.body).toContain("3 из 7"); // у Greg активные дни 9, 13 и 14 октября из окна 8-14
|
||||
expect(r.body).toContain("Stale Days");
|
||||
expect(r.body).toContain("export?date=2026-10-14");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user