Refine web quick panels and Wi-Fi controls
This commit is contained in:
@@ -115,6 +115,32 @@ async function test(name, fn) { await fn(); ++passed; console.log('PASS JS:', na
|
||||
trigger.pointerenter({pointerType:'mouse'}); await tick(); assert.equal(host['data-quick'],'false');
|
||||
b.terminals[0].input('x'); assert.equal(ws.sent.length, 1); assert.ok(!ws.closed);
|
||||
});
|
||||
await test('Every quick card retains Serial/Admin title, toolbar and selected-view semantics until full promotion', async () => {
|
||||
for (const mode of ['serial', 'admin']) for (const domain of ['serial', 'network', 'broker', 'writer']) {
|
||||
const b = browser({role:'admin'}); b.start(); await tick();
|
||||
if (mode === 'admin') { b.click('select-admin'); await tick(); }
|
||||
const assertView = view => {
|
||||
assert.equal(b.nodes['terminal-title'].textContent, {serial:'Live serial stream', admin:'Administration shell', settings:'Settings'}[view], domain);
|
||||
for (const id of ['admin-toggle', 'admin-detail']) assert.equal(b.nodes[id].hidden, view !== 'admin', id);
|
||||
for (const choice of ['serial', 'admin', 'settings']) assert.equal(b.nodes['select-' + choice]['aria-pressed'], String(choice === view), choice);
|
||||
assert.equal(b.nodes.terminal.hidden, view !== 'serial');
|
||||
assert.equal(b.nodes['admin-terminal'].hidden, view !== 'admin');
|
||||
};
|
||||
b.click('quick-' + domain); await tick(); assertView(mode);
|
||||
assert.equal(b.nodes['serial-settings'].hidden, false);
|
||||
assert.equal(b.nodes['serial-settings']['data-quick'], 'true');
|
||||
b.click('quick-close'); await tick(); assertView(mode);
|
||||
b.click('quick-' + domain); await tick();
|
||||
const calls = b.calls.length;
|
||||
b.nodes['quick-full'].click({preventDefault(){}}); await tick();
|
||||
assertView('settings');
|
||||
assert.equal(b.nodes['serial-settings']['data-quick'], 'false');
|
||||
assert.equal(b.nodes['quick-header'].hidden, true);
|
||||
assert.equal(b.nodes['quick-' + domain]['aria-expanded'], 'false');
|
||||
assert.equal(b.document.activeElement, b.nodes['settings-' + (domain === 'writer' ? 'broker' : domain)]);
|
||||
assert.equal(b.calls.length, calls, 'promotion must not reload the shared controller');
|
||||
}
|
||||
});
|
||||
await test('Quick adjacent trigger keyboard focus survives switching without focusing either terminal', async () => {
|
||||
const b = browser({role:'admin'}); b.start(); await tick();
|
||||
b.nodes['quick-network'].focus(); await tick();
|
||||
|
||||
Reference in New Issue
Block a user