Show configured metrics retention (Refs #141)

This commit is contained in:
2026-10-10 17:57:02 -04:00
parent 528ed7f37a
commit d6041e40ef
8 changed files with 62 additions and 3 deletions
+20
View File
@@ -54,6 +54,7 @@ function report(): MetricsData {
const summary = { observed: 10, active: 5, idle: 5, unknown: 2, playerHours: 20 };
return {
days: 7,
metricsKeepDays: 31,
since: now - 7 * 86400000,
now,
firstRetainedSampleAt: now - 14 * 86400000,
@@ -116,6 +117,25 @@ function scope(search: string, stateSearch?: string) {
}
beforeEach(() => scope(''));
it.each([
[31, 'for 31 days'],
[90, 'for 90 days'],
[1, 'for 1 day'],
[0, 'indefinitely']
] as const)(
'shows configured occupancy retention of %i days in About this report',
(metricsKeepDays, expected) => {
const body = render(MetricsPage, {
props: { data: { ...report(), metricsKeepDays, user: null, setupRequired: false } }
})
.body.replace(/<!--[\s\S]*?-->/g, '')
.replace(/\s+/g, ' ');
const about = body.slice(body.indexOf('About this report'));
expect(about).toContain(`Occupancy history is retained ${expected};`);
expect(about).toContain('saved match retention is configured separately');
}
);
it('shows Provisioning outcomes and readiness with a policy link, even without occupancy', () => {
const data = report();
const section = render(MetricsAutoscaling, { props: { metrics: data.autoscaling } }).body;