fmt(js): npm run fix on merge (#92714)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
38ce2d7553
commit
d49d495c2b
@@ -90,10 +90,7 @@ test('resolvedConnectionId identifies local and migrated remote descriptors', ()
|
||||
|
||||
const ambiguousLocal: ConnectionRegistry = {
|
||||
...registry,
|
||||
connections: [
|
||||
...registry.connections,
|
||||
{ id: 'local-copy', kind: 'local', label: 'Local copy' }
|
||||
]
|
||||
connections: [...registry.connections, { id: 'local-copy', kind: 'local', label: 'Local copy' }]
|
||||
}
|
||||
|
||||
assert.equal(resolvedConnectionId(ambiguousLocal, { mode: 'local' }), null)
|
||||
@@ -283,14 +280,8 @@ test('resolvedConnectionId reuses the exact URL envelope and rejects weak or dup
|
||||
)
|
||||
|
||||
// Post-dial URL-only shapes do not contain enough proof to choose a source.
|
||||
assert.equal(
|
||||
resolvedConnectionId(registry, { baseUrl: sharedUrl, mode: 'remote', remoteKind: 'url' }),
|
||||
null
|
||||
)
|
||||
assert.equal(
|
||||
resolvedConnectionId(registry, { baseUrl: sharedUrl, mode: 'remote', remoteKind: 'cloud' }),
|
||||
null
|
||||
)
|
||||
assert.equal(resolvedConnectionId(registry, { baseUrl: sharedUrl, mode: 'remote', remoteKind: 'url' }), null)
|
||||
assert.equal(resolvedConnectionId(registry, { baseUrl: sharedUrl, mode: 'remote', remoteKind: 'cloud' }), null)
|
||||
|
||||
// Even a complete envelope fails closed when two registrations are exact twins.
|
||||
const duplicate: ConnectionRegistry = {
|
||||
@@ -395,10 +386,7 @@ test('resolvedConnectionId keeps same-host SSH routes distinct by port, key, pat
|
||||
connections: [...registry.connections, { ...base, id: 'ssh-base-copy', label: 'SSH base copy' }]
|
||||
}
|
||||
|
||||
assert.equal(
|
||||
resolvedConnectionId(duplicate, { mode: 'remote', remoteKind: 'ssh', ssh: base }),
|
||||
null
|
||||
)
|
||||
assert.equal(resolvedConnectionId(duplicate, { mode: 'remote', remoteKind: 'ssh', ssh: base }), null)
|
||||
assert.equal(
|
||||
resolvedConnectionId(
|
||||
{ ...duplicate, connections: [...duplicate.connections].reverse() },
|
||||
|
||||
@@ -232,9 +232,7 @@ export function resolvedConnectionId(
|
||||
return null
|
||||
}
|
||||
|
||||
return registry.connections.some(connection => connection.id === explicitConnectionId)
|
||||
? explicitConnectionId
|
||||
: null
|
||||
return registry.connections.some(connection => connection.id === explicitConnectionId) ? explicitConnectionId : null
|
||||
}
|
||||
|
||||
if (descriptor.mode === 'local') {
|
||||
@@ -335,11 +333,7 @@ export function resolvedConnectionId(
|
||||
return matchingConnectionId(registry, route, 'unique') ?? null
|
||||
}
|
||||
|
||||
function normalizedSshTarget(route: {
|
||||
host?: unknown
|
||||
port?: unknown
|
||||
user?: unknown
|
||||
}): null | string {
|
||||
function normalizedSshTarget(route: { host?: unknown; port?: unknown; user?: unknown }): null | string {
|
||||
const ssh = normalizeSshConfig({ ...route, mode: 'ssh' })
|
||||
|
||||
if (!ssh) {
|
||||
|
||||
@@ -6,12 +6,7 @@
|
||||
* but must never reconstruct a stronger identity from post-dial metadata.
|
||||
*/
|
||||
|
||||
import {
|
||||
normalizeRemoteBaseUrl,
|
||||
normalizeRemoteHeaders,
|
||||
normalizeSshConfig,
|
||||
normAuthMode
|
||||
} from './connection-config'
|
||||
import { normalizeRemoteBaseUrl, normalizeRemoteHeaders, normalizeSshConfig, normAuthMode } from './connection-config'
|
||||
import type { ConnectionRegistry, RegistryConnection } from './connection-registry'
|
||||
|
||||
interface SshRouteConfig {
|
||||
|
||||
@@ -17,7 +17,8 @@ vi.mock('@/lib/query-client', () => ({ invalidateProfileScopedQueries: vi.fn() }
|
||||
vi.mock('@/store/starmap', () => ({ resetStarmapGraph: vi.fn() }))
|
||||
|
||||
const { $activeGatewayProfile } = await import('./profile')
|
||||
const { $settingsRequestProfile, $settingsScopeOverride, $settingsScopeProfile, setSettingsScope } = await import('./settings-scope')
|
||||
const { $settingsRequestProfile, $settingsScopeOverride, $settingsScopeProfile, setSettingsScope } =
|
||||
await import('./settings-scope')
|
||||
|
||||
beforeEach(() => {
|
||||
$activeGatewayProfile.set('default')
|
||||
|
||||
Reference in New Issue
Block a user