Add network identity diagnostics
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 16:19:23 +03:00
parent 3566f4bc0b
commit 6381760b27
8 changed files with 211 additions and 9 deletions
+16 -1
View File
@@ -20,6 +20,13 @@ const pathResult = {
ipv4: { addresses: ['198.51.100.10'], sources: [ip] },
ipv6: null,
ipv6Source: null,
network: {
address: '198.51.100.10',
asn: 'AS12389',
provider: 'Rostelecom',
city: 'Moscow',
country: 'RU',
},
sites: [site],
};
const valid = {
@@ -62,6 +69,7 @@ test('unknown target and legacy-full results pass one identity-preserving parser
{ ...valid, direct: { ...valid.direct, available: 'yes' } },
{ ...valid, direct: { ...valid.direct, ipv4: { addresses: [], sources: [{}] } } },
{ ...valid, direct: { ...valid.direct, ipv6: 6 } },
{ ...valid, direct: { ...valid.direct, network: { ...valid.direct.network, asn: 12389 } } },
{ ...valid, direct: { ...valid.direct, sites: [{ ...site, id: '' }] } },
{ ...valid, direct: { ...valid.direct, sites: [{ ...site, status: 'blocked' }] } },
{ ...valid, direct: { ...valid.direct, sites: [{ ...site, latencyMs: -1 }] } },
@@ -75,7 +83,7 @@ test('unknown target and legacy-full results pass one identity-preserving parser
});
test('serial probes, storage and editor behavior stay panel-owned', () => {
assert.match(panel, /const targets = \[[\s\S]*CONNECTIVITY_IP_SOURCES\.map[\s\S]*sites\.map/);
assert.match(panel, /const targets = \[[\s\S]*CONNECTIVITY_NETWORK_SOURCE\.id[\s\S]*CONNECTIVITY_IP_SOURCES\.map[\s\S]*sites\.map/);
assert.match(panel, /for \(const target of targets\) \{[\s\S]*setActiveTarget\(target\)[\s\S]*await runConnectivityDiagnostics\(customServices, target\)[\s\S]*if \(legacyFullResult\) break/);
assert.match(panel, /CUSTOM_SERVICES_KEY = 'harbor-diagnostic-services'/);
assert.match(panel, /HIDDEN_SERVICES_KEY = 'harbor-hidden-diagnostic-services'/);
@@ -85,3 +93,10 @@ test('serial probes, storage and editor behavior stay panel-owned', () => {
assert.match(panel, /retryable: Boolean\(Reflect\.get\(value, 'retryable'\)\)/);
assert.match(panel, /requestDetails\(error\)[\s\S]*requestError\.retryable/);
});
test('network identity is one stable compact row for Direct and VPN', () => {
assert.match(panel, /data-diagnostic-target=\{CONNECTIVITY_NETWORK_SOURCE\.id\}[\s\S]*<NetworkCell[\s\S]*route="Напрямую, сеть"[\s\S]*<NetworkCell[\s\S]*route="VPN, сеть"/);
assert.match(panel, /path\?\.network\?\.asn[\s\S]*path\?\.network\?\.provider[\s\S]*path\?\.network\?\.city[\s\S]*path\?\.network\?\.country/);
assert.match(panel, /<Status value=\{status\} route=\{route\} \/><br \/>[\s\S]*client-diagnostics-status is-muted[\s\S]*&nbsp;/);
assert.doesNotMatch(panel, /traceroute|tracepath/);
});