Files
openchamber/packages/web/server/lib/opencode/config-mutation-response.test.js
T
Cursor AgentandSerhii Dziupin 57819dd164 Accumulate OpenCode settings restarts behind Apply & Restart
Defer OpenCode reloads after settings mutations, track pending changes,
and expose a top-right Apply & Restart OpenCode action with a counter so
sessions stay available until the user explicitly applies.

Co-authored-by: Serhii Dziupin <makeittech@users.noreply.github.com>
2026-08-03 06:56:38 +00:00

28 lines
863 B
JavaScript

import { describe, expect, test } from 'bun:test';
import {
buildDeferredRestartResponse,
buildExternalManualRestartResponse,
} from './config-mutation-response.js';
describe('config mutation response helpers', () => {
test('buildDeferredRestartResponse marks restart as deferred', () => {
expect(buildDeferredRestartResponse('Saved. Restart OpenCode to apply.')).toEqual({
success: true,
requiresReload: false,
requiresRestart: true,
restartDeferred: true,
message: 'Saved. Restart OpenCode to apply.',
});
});
test('buildExternalManualRestartResponse asks for external restart', () => {
expect(buildExternalManualRestartResponse('Restart your server.')).toEqual({
success: true,
requiresReload: false,
requiresManualRestart: true,
message: 'Restart your server.',
});
});
});