From 8269d2d37e08b62c2aa8541d945e3104149c59ea Mon Sep 17 00:00:00 2001 From: chihumyum Date: Sun, 6 Sep 2026 16:13:18 +0800 Subject: [PATCH] test(desktop): pin the About reader's missing-provider throw `AppUpdateAboutProjectionConsumer` throws when mounted outside `AppUpdateProvider`; the scope suite covered only the mounted path. Add the `assert.throws` render case, and trim the `AboutUpdateStatusRow` doc comment to the sentence the next editor needs (the ownership argument now lives in the PR body). --- .../src/main/__tests__/app-update-provider-scope.test.ts | 9 +++++++++ .../src/renderer/settings/about-settings-page.tsx | 8 ++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/apps/desktop/src/main/__tests__/app-update-provider-scope.test.ts b/apps/desktop/src/main/__tests__/app-update-provider-scope.test.ts index 33c4aeb649..70f696a8dd 100644 --- a/apps/desktop/src/main/__tests__/app-update-provider-scope.test.ts +++ b/apps/desktop/src/main/__tests__/app-update-provider-scope.test.ts @@ -256,4 +256,13 @@ describe('AppUpdateProvider render scope', () => { }); await act(async () => root.unmount()); }); + + test('throws for an About reader mounted outside AppUpdateProvider', () => { + const { root } = installReactRenderer(); + assert.throws( + () => act(() => root.render(createElement(AboutProbe))), + { message: 'AppUpdateProvider is missing' }, + ); + assert.equal(aboutRenders, 0); + }); }); diff --git a/apps/desktop/src/renderer/settings/about-settings-page.tsx b/apps/desktop/src/renderer/settings/about-settings-page.tsx index ea5366c7b1..6ef840c887 100644 --- a/apps/desktop/src/renderer/settings/about-settings-page.tsx +++ b/apps/desktop/src/renderer/settings/about-settings-page.tsx @@ -63,12 +63,8 @@ const linkInRowEnd = { paddingInline: 'var(--spacing-3)' } as const; type AboutCopy = ReturnType['about']; /** - * The updater's row, rendered only for a packaged install. Update state is not - * this page's to own: the App Update feature holds the renderer's sole updater - * subscription above AppShell and publishes About's projection, so the row - * reads status from the consumer and issues the feature's guarded check - * instead of touching the bridge. A component rather than the consumer's - * render callback because the action guard is a hook. + * About's update row for a packaged install. A component rather than the + * consumer's render callback because the action guard is a hook. */ function AboutUpdateStatusRow(props: { readonly update: AppUpdateAboutProjection;