Refactor VPN proxy components and update related behavior
Build and Deploy Gateway / build-and-push (push) Successful in 20s
Build and Deploy Gateway / deploy (push) Successful in 13s

This commit is contained in:
2026-08-11 01:27:46 +03:00
parent c89e56942a
commit aa9c959368
58 changed files with 4234 additions and 2755 deletions
+10 -16
View File
@@ -12,7 +12,12 @@ import { createStateSnapshot } from '../../.test-dist/src/shared/contracts/state
const snapshot = (revision, desiredServerId = '', serverIds = ['one', 'two']) => ({
apiVersion: 1,
revision,
selection: { desiredServerId },
profiles: [{
id: 'primary',
desiredServerId,
servers: serverIds.map((id) => ({ id })),
}],
selection: { desiredProfileId: 'primary', desiredServerId },
servers: serverIds.map((id) => ({ id })),
});
@@ -87,21 +92,10 @@ test('an equal revision keeps the current snapshot identity', () => {
assert.equal(next.snapshot.selection.desiredServerId, 'one');
});
test('pending selection survives polling until canonical state acknowledges it', () => {
let state = receive(initialHarborState, snapshot(1, 'one'));
state = harborReducer(state, { type: 'select-server', serverId: 'two' });
state = receive(state, snapshot(2, 'one'));
assert.equal(state.pendingServerId, 'two');
state = receive(state, snapshot(3, 'two'));
assert.equal(state.pendingServerId, '');
});
test('pending selection is cleared when its server disappears', () => {
let state = receive(initialHarborState, snapshot(1, 'one'));
state = harborReducer(state, { type: 'select-server', serverId: 'two' });
assert.equal(receive(state, snapshot(2, 'one', ['one'])).pendingServerId, '');
test('selection has no client-side shadow and follows canonical profile snapshots', () => {
const state = receive(initialHarborState, snapshot(2, 'two'));
assert.equal(Object.hasOwn(state, 'pendingServerId'), false);
assert.equal(state.snapshot.profiles[0].desiredServerId, 'two');
});
test('data invariant: initial control outage is retryable without a fabricated snapshot', () => {