Refine server picker ping labels and layout
This commit is contained in:
@@ -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\]}/);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user