diff --git a/apps/desktop/src/app/updates-overlay.channel.test.tsx b/apps/desktop/src/app/updates-overlay.channel.test.tsx index 4ed17bec0c..02e30fc7df 100644 --- a/apps/desktop/src/app/updates-overlay.channel.test.tsx +++ b/apps/desktop/src/app/updates-overlay.channel.test.tsx @@ -15,7 +15,13 @@ afterEach((): void => { }) async function openWith(status: Partial): Promise { - $desktopVersion.set({ appVersion: '0.21.6', electronVersion: '37', hermesRoot: '/h', nodeVersion: '22', platform: 'linux' }) + $desktopVersion.set({ + appVersion: '0.21.6', + electronVersion: '37', + hermesRoot: '/h', + nodeVersion: '22', + platform: 'linux' + }) $updateStatus.set({ behind: 0, mechanism: 'posix-handoff', ...status, supported: true }) $updateOverlayTarget.set('client') $updateOverlayOpen.set(true) diff --git a/apps/desktop/src/components/update-status.test.tsx b/apps/desktop/src/components/update-status.test.tsx index dd0f3235c3..6c8abe4801 100644 --- a/apps/desktop/src/components/update-status.test.tsx +++ b/apps/desktop/src/components/update-status.test.tsx @@ -45,8 +45,22 @@ function derive(status: DesktopUpdateStatus | null, apply: UpdateApplyState = ID describe('deriveUpdateStatus', () => { it('names the stable release only when the checkout is on it', () => { const latestRelease = en.settings.about.channel.latestRelease - const stable = { supported: true, behind: 0, channel: 'stable', sourceVersion: '0.21.6', targetSha: 'a'.repeat(40), aheadOfRelease: false } - const on = deriveUpdateStatus({ apply: IDLE_APPLY, checking: false, latestRelease, status: { ...stable, currentSha: 'a'.repeat(40) }, target: 'client', u: en.updates }) + const stable = { + supported: true, + behind: 0, + channel: 'stable', + sourceVersion: '0.21.6', + targetSha: 'a'.repeat(40), + aheadOfRelease: false + } + const on = deriveUpdateStatus({ + apply: IDLE_APPLY, + checking: false, + latestRelease, + status: { ...stable, currentSha: 'a'.repeat(40) }, + target: 'client', + u: en.updates + }) expect(on.line).toBe('You’re on the latest stable release (v0.21.6).') // Ahead of the release (forward-only): the check pins the target to HEAD, so diff --git a/apps/desktop/src/components/update-status.tsx b/apps/desktop/src/components/update-status.tsx index e92d302c2e..7a10c3dd99 100644 --- a/apps/desktop/src/components/update-status.tsx +++ b/apps/desktop/src/components/update-status.tsx @@ -84,7 +84,14 @@ export function deriveUpdateStatus(input: UpdateStatusInput): UpdateStatusView { return ordinaryUpdateStatus(input) } -function ordinaryUpdateStatus({ apply, checking, latestRelease, status, target, u }: UpdateStatusInput): UpdateStatusView { +function ordinaryUpdateStatus({ + apply, + checking, + latestRelease, + status, + target, + u +}: UpdateStatusInput): UpdateStatusView { const behind = status?.behind ?? 0 // behind is null when the exact count is unknowable (shallow clone): the // backend flags that case via updateAvailable instead of a number. @@ -137,11 +144,7 @@ function ordinaryUpdateStatus({ apply, checking, latestRelease, status, target, return { applying, line: - target === 'backend' - ? u.latestBodyBackend - : pinned - ? latestRelease(`v${status.sourceVersion}`) - : u.latestBody, + target === 'backend' ? u.latestBodyBackend : pinned ? latestRelease(`v${status.sourceVersion}`) : u.latestBody, supported, tone: 'idle', updateAvailable diff --git a/apps/desktop/src/components/version-details.test.tsx b/apps/desktop/src/components/version-details.test.tsx index 6539b9ab16..d76b716cc9 100644 --- a/apps/desktop/src/components/version-details.test.tsx +++ b/apps/desktop/src/components/version-details.test.tsx @@ -139,7 +139,10 @@ describe('VersionDetails', () => { const render_ = (action?: boolean) => render( - Change : undefined} version={baseVersion} /> + Change : undefined} + version={baseVersion} + /> )