Refine server picker ping labels and layout
All checks were successful
Build and Deploy Gateway / build-and-push (push) Successful in 15s
Build and Deploy Gateway / deploy (push) Successful in 7s

This commit is contained in:
2026-07-14 22:53:06 +03:00
parent 162ef861d7
commit 8139543e9a
5 changed files with 26 additions and 19 deletions

View File

@@ -13,6 +13,7 @@ import {
const root = path.resolve(import.meta.dirname, '../..');
const picker = fs.readFileSync(path.join(root, 'src/web/components/ServerPicker.jsx'), 'utf8');
const overview = fs.readFileSync(path.join(root, 'src/web/components/ClientOverviewPage.jsx'), 'utf8');
const styles = fs.readFileSync(path.join(root, 'src/web/styles.css'), 'utf8');
const fixtures = (count) => Array.from({ length: count }, (_, index) => ({
id: `srv-${String(count - index).padStart(3, '0')}`,
@@ -52,10 +53,14 @@ test('server picker checks health only on manual refresh and bounds the result w
assert.match(picker, /aria-expanded={!isCollapsed}/);
});
test('manual health remains visible for Auto and simple rows', () => {
test('manual ping uses plain language and keeps results beside server names', () => {
assert.match(picker, /function ServerHealth/);
assert.match(picker, /client-server-health-checking/);
assert.match(picker, /function ServerCheckButton/);
assert.match(picker, /<span>Проверить пинг<\/span>/);
assert.doesNotMatch(picker, /TCP|Не проверен/);
assert.match(styles, /\.client-server \{[\s\S]*?align-items: baseline;[\s\S]*?justify-content: center;/);
assert.match(styles, /\.client-server-grid \{[\s\S]*?width: min\(100%, 220px\);/);
assert.match(picker, /server={servers\[0\]}[\s\S]*?ping={pings\[servers\[0\]\.id\]}/);
assert.match(picker, /simpleServers\.map[\s\S]*?ping={pings\[server\.id\]}/);
});