diff --git a/src/main/runtime/autoplay-subtitle-priming-runtime.test.ts b/src/main/runtime/autoplay-subtitle-priming-runtime.test.ts index 8a9a0faa..c5b21107 100644 --- a/src/main/runtime/autoplay-subtitle-priming-runtime.test.ts +++ b/src/main/runtime/autoplay-subtitle-priming-runtime.test.ts @@ -16,3 +16,13 @@ test('setMpvCurrentSecondarySubText uses client setter when available', () => { assert.deepEqual(calls, ['secondary']); assert.equal(client.currentSecondarySubText, ''); }); + +test('setMpvCurrentSecondarySubText updates client property when setter is unavailable', () => { + const client = { + currentSecondarySubText: '', + }; + + setMpvCurrentSecondarySubText(client, 'secondary'); + + assert.equal(client.currentSecondarySubText, 'secondary'); +}); diff --git a/src/main/runtime/stats-server-runtime.test.ts b/src/main/runtime/stats-server-runtime.test.ts index 05a6ac91..8632244e 100644 --- a/src/main/runtime/stats-server-runtime.test.ts +++ b/src/main/runtime/stats-server-runtime.test.ts @@ -5,7 +5,7 @@ import { shouldClearAppStateStatsServerOnStop, } from './stats-server-runtime'; -test('background stats daemon state owned by the current process is stale for stop flow', () => { +test('detects self-owned background stats daemon state', () => { assert.equal( isSelfOwnedBackgroundStatsDaemonState({ pid: process.pid, port: 6969, startedAtMs: 1 }), true, diff --git a/src/main/runtime/update/update-service-runtime.test.ts b/src/main/runtime/update/update-service-runtime.test.ts index 7b73cfe0..781d0979 100644 --- a/src/main/runtime/update/update-service-runtime.test.ts +++ b/src/main/runtime/update/update-service-runtime.test.ts @@ -18,3 +18,26 @@ test('runSupportAssetUpdatesForLauncherResult logs support-asset errors and pres assert.equal(result, launcherResult); assert.deepEqual(warnings, ['Support asset update failed after launcher update:archive failed']); }); + +test('runSupportAssetUpdatesForLauncherResult uses support asset description in skip warnings', async () => { + const warnings: string[] = []; + const launcherResult = { status: 'updated' } as const; + + const result = await runSupportAssetUpdatesForLauncherResult({ + launcherResult, + assetDescription: 'Support asset update', + updateSupportAssets: async () => [ + { status: 'protected', command: 'install-theme' }, + { status: 'hash-mismatch', message: 'checksum failed' }, + ], + logWarn: (message) => { + warnings.push(message); + }, + }); + + assert.equal(result, launcherResult); + assert.deepEqual(warnings, [ + 'Support asset update requires manual command: install-theme', + 'Support asset update skipped: checksum failed', + ]); +}); diff --git a/src/main/runtime/update/update-service-runtime.ts b/src/main/runtime/update/update-service-runtime.ts index b4a0e992..7ddcd3ac 100644 --- a/src/main/runtime/update/update-service-runtime.ts +++ b/src/main/runtime/update/update-service-runtime.ts @@ -82,6 +82,7 @@ export function createUpdateServiceRuntime(deps: UpdateServiceRuntimeDeps): { }); return runSupportAssetUpdatesForLauncherResult({ launcherResult, + assetDescription: 'Support asset update', updateSupportAssets: () => updateSupportAssetsFromRelease({ release, diff --git a/src/main/runtime/update/update-support-assets-runtime.ts b/src/main/runtime/update/update-support-assets-runtime.ts index 12a97d30..fa4634f6 100644 --- a/src/main/runtime/update/update-support-assets-runtime.ts +++ b/src/main/runtime/update/update-support-assets-runtime.ts @@ -3,16 +3,18 @@ export async function runSupportAssetUpdatesForLauncherResult< TSupportResult extends { status: string; command?: string; message?: string }, >(options: { launcherResult: TLauncherResult; + assetDescription?: string; updateSupportAssets: () => Promise; logWarn: (message: string, details?: unknown) => void; }): Promise { + const assetDescription = options.assetDescription ?? 'Support asset update'; try { const supportResults = await options.updateSupportAssets(); for (const result of supportResults) { if (result.status === 'protected' && result.command) { - options.logWarn(`Rofi theme update requires manual command: ${result.command}`); + options.logWarn(`${assetDescription} requires manual command: ${result.command}`); } else if (result.status === 'hash-mismatch' || result.status === 'missing-asset') { - options.logWarn(`Rofi theme update skipped: ${result.message ?? result.status}`); + options.logWarn(`${assetDescription} skipped: ${result.message ?? result.status}`); } } } catch (error) {