From ff5ee755f24342d64c47f2a484e80b1674ed69a2 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Mon, 2 Nov 2026 15:04:32 -0500 Subject: [PATCH] fix: the backup test result says its count through plural(), and the panel tests read the size and folder field as shown Co-Authored-By: Claude Opus 5.5 --- web/src/lib/components/admin/BackupPanel.test.ts | 4 ++-- web/src/lib/components/admin/BackupSettings.svelte | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/web/src/lib/components/admin/BackupPanel.test.ts b/web/src/lib/components/admin/BackupPanel.test.ts index 7908bea8..346caaa9 100644 --- a/web/src/lib/components/admin/BackupPanel.test.ts +++ b/web/src/lib/components/admin/BackupPanel.test.ts @@ -71,7 +71,7 @@ describe('BackupPanel', () => { expect(verdict()).toMatch(/^ ?Backed up /); expect(verdict()).toMatch(/Next backup /); const runs = screen.getByRole('list', { name: /latest backups/i }); - expect(runs.textContent).toMatch(/Scheduled · database\/minstrel-20261102T030000Z\.tar · 12 MB/); + expect(runs.textContent).toMatch(/Scheduled · database\/minstrel-20261102T030000Z\.tar · 12\.0 MB/); expect(runs.textContent).toMatch(/Saved/); }); @@ -181,7 +181,7 @@ describe('BackupPanel', () => { test('the folder destination asks for a path, not a bucket', async () => { await renderPanel(status({ config: { ...base.config, destination: 'folder', folder: '/backups' } })); - expect(screen.getByLabelText(/^folder$/i)).toHaveProperty('value', '/backups'); + expect(screen.getByRole('textbox', { name: /^folder$/i })).toHaveProperty('value', '/backups'); expect(screen.queryByLabelText(/^bucket$/i)).toBeNull(); }); }); diff --git a/web/src/lib/components/admin/BackupSettings.svelte b/web/src/lib/components/admin/BackupSettings.svelte index e02d4c01..bdfbb09e 100644 --- a/web/src/lib/components/admin/BackupSettings.svelte +++ b/web/src/lib/components/admin/BackupSettings.svelte @@ -13,6 +13,7 @@ import SettingsGroup from '#lib/components/settings/SettingsGroup.svelte'; import SettingRow from '#lib/components/settings/SettingRow.svelte'; import Segmented from '#lib/components/settings/Segmented.svelte'; + import { plural } from '#lib/utils/plural.js'; import { hourLabel, when } from './backupTime.js'; // Where the nightly backup goes and when. The form keeps its own drafts, @@ -175,7 +176,7 @@ {#if check.backups === 0} No backups there yet. {:else} - {check.backups} {check.backups === 1 ? 'backup' : 'backups'} there, the newest from {when(check.latest!)}. + {plural(check.backups, 'backup', 'backups')} there, the newest from {when(check.latest!)}. {/if}

{/if}