fix(gateway): 일시정지와 서버 중지 상태 계약 분리

This commit is contained in:
2026-08-15 17:12:13 +00:00
parent dc27766dd6
commit 4f841ad82f
16 changed files with 320 additions and 41 deletions
@@ -0,0 +1,26 @@
import { describe, expect, it } from 'vitest';
import { GATEWAY_PROFILE_STATUSES, gatewayProfileCapabilities } from '../src/gateway/profileStatus.js';
describe('gateway profile status capabilities', () => {
it('keeps PAUSED accessible while stopping only turn execution', () => {
expect(gatewayProfileCapabilities('PAUSED')).toEqual({
runtimeExpected: true,
userAccessible: true,
turnsRunning: false,
operatorResumable: true,
});
});
it('keeps STOPPED inaccessible while allowing an operator restart', () => {
expect(gatewayProfileCapabilities('STOPPED')).toEqual({
runtimeExpected: false,
userAccessible: false,
turnsRunning: false,
operatorResumable: true,
});
});
it('defines capabilities for every persisted status', () => {
expect(GATEWAY_PROFILE_STATUSES.map((status) => gatewayProfileCapabilities(status))).toHaveLength(7);
});
});