mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-14 14:17:18 +00:00
fix(v5): preserve firewall directions when editing ports
This commit is contained in:
1 parent
6ae45684f9
commit
9db103cc77
2 files changed
+38
-12
No files matched your search
@@ -930,3 +930,20 @@ it('hardens v5 dashboard fetches and websocket merges against failures', functio
|
||||
|
||||
expect(strpos($addNginxSource, '!response.ok'))->not->toBeFalse();
|
||||
});
|
||||
|
||||
it('preserves all v5 resource connection firewall directions when editing ports', function () {
|
||||
$connectionsHook = file_get_contents(resource_path('js/v5/lib/use-canvas-connections.ts'));
|
||||
$updateDirectionSource = substr(
|
||||
$connectionsHook,
|
||||
strpos($connectionsHook, 'const updateConnectionDirection'),
|
||||
strpos($connectionsHook, 'const setConnectionPortDraft') - strpos($connectionsHook, 'const updateConnectionDirection'),
|
||||
);
|
||||
|
||||
expect($connectionsHook)
|
||||
->toContain('function connectionPortsPayload(connection: CanvasConnection)')
|
||||
->toContain('body: { ports_by_direction: connectionPortsPayload(updatedConnection) }')
|
||||
->toContain('preserveActiveDirection(nextConnection, updatedConnection)')
|
||||
->and($updateDirectionSource)
|
||||
->toContain('replaceConnection(updatedConnection)')
|
||||
->not->toContain('persistConnectionPorts(updatedConnection, connection)');
|
||||
});
|
||||
Reference in new issue
Block a user