Reposition Gateway traffic summary below power controls
This commit is contained in:
@@ -166,12 +166,19 @@ test('Gateway device inventory uses the existing accessible responsive drawer',
|
||||
});
|
||||
|
||||
test('Gateway Home reuses the canonical device snapshot for applied route and global traffic', () => {
|
||||
const powerStart = overview.indexOf('<section className="client-power-section"');
|
||||
const trafficStart = overview.indexOf('<section className="client-gateway-summary"');
|
||||
const powerPrefix = overview.slice(powerStart, trafficStart);
|
||||
|
||||
assert.match(overview, /const appliedServerId = state\?\.selection\?\.appliedServerId \|\| ''/);
|
||||
assert.match(overview, /appliedServer\?\.label \|\| 'VPN-сервер не используется'/);
|
||||
assert.match(overview, /selectedServerId !== appliedServerId[\s\S]*Переключаем на \{desiredServer\.label\}/);
|
||||
assert.match(overview, /formatByteString\(globalTraffic\?\.totalBytes \|\| '0'\)/);
|
||||
assert.match(overview, /samples=\{globalTraffic\?\.history \|\| \[\]\}[\s\S]*capacity=\{deviceSnapshot\?\.trafficHistoryCapacity \|\| 120\}[\s\S]*routeLabel="Gateway"/);
|
||||
assert.match(overview, /<section className="client-power-section"[\s\S]*client-connection-title[\s\S]*client-gateway-route-summary[\s\S]*client-state-detail[\s\S]*<section className="client-gateway-summary"[\s\S]*client-proxies/);
|
||||
assert.match(overview, /<section className="client-power-section"[\s\S]*client-connection-title[\s\S]*client-gateway-route-summary[\s\S]*client-state-detail[\s\S]*client-proxies[\s\S]*<section className="client-gateway-summary"/);
|
||||
assert.ok(powerStart >= 0 && trafficStart > powerStart, 'traffic summary follows the power section');
|
||||
assert.equal((powerPrefix.match(/<section\b/g) || []).length, (powerPrefix.match(/<\/section>/g) || []).length, 'power section is closed before traffic summary');
|
||||
assert.equal((overview.match(/className="client-gateway-summary"/g) || []).length, 1);
|
||||
assert.doesNotMatch(overview, /<TrafficChart[\s\S]{0,240}scale=/);
|
||||
assert.match(overview, /deviceStatus === 'error' \? deviceError : null/);
|
||||
assert.match(overview, /if \(!isGateway && \(!connected \|\| !state\?\.singboxStartedAt\)\) return undefined/);
|
||||
|
||||
Reference in New Issue
Block a user