Files
simtrace-analyser/frontend/tests/style.test.js
T
catarrh b743c6621d Detail view: P3 says Lc or Le, and SEARCH RECORD names its target (v2.7.9)
- the P3 row read "0x02 — 2 bytes" for both kinds of P3; the decode now marks
  it (p3_kind): a command that carries data has Lc (the command-data length),
  a case-2 command (APDU_SPEC 'le', e.g. READ BINARY/RECORD, GET RESPONSE,
  SEARCH…) has Le (the expected response length).  The detail row appends
  "· Lc (command data length)" / "· Le (expected response length)"
  («Lc (длина данных команды)» / «Le (ожидаемая длина ответа)»)
- a SEARCH RECORD without an SFI searched the current EF (TS 102 221
  §11.1.7.1) but showed no file at all; it now resolves like READ/UPDATE:
  the SFI's declared file when SFI-addressed (an unresolved SFI stays marked
  "SFI n"), otherwise the current selection — with the stale-selection note
  when that EF is not a record file.  Verified on session 193: the 5.371 s
  search (P2=0x04, no SFI) now shows 4FA1, the 5.434 s one (SFI 2) shows 4F3A
- tests: p3_kind cases (Le/Lc/none) and the SEARCH target cases (current EF,
  SFI-resolved, unknown SFI, transparent selection); a Node pin for the P3
  row and the two new Russian strings; 540 Python + 77 Node tests
- PWA_VERSION/pyproject/version.py 2.7.9, SW cache simtrace-analyser-v89
2026-10-18 01:34:01 +03:00

55 lines
2.6 KiB
JavaScript

// Scrollbar styling: every pane shares one global rule (12px bars, 6px
// rounded thumb) — the APDU list used to be 12px while the side panel,
// detail pane, dialogs and session lists fell back to a 6px default.
const { test } = require('node:test');
const assert = require('node:assert');
const { loadSrc } = require('./helpers.js');
const src = loadSrc();
test('every pane uses the global 12px scrollbar rule', () => {
assert.match(src, /::-webkit-scrollbar \{ width: 12px; height: 12px; \}/);
assert.match(
src,
/::-webkit-scrollbar-thumb \{ background: var\(--scrollbar-thumb\); border-radius: 6px; \}/);
assert.match(src, /::-webkit-scrollbar-track \{ background: var\(--scrollbar-track\); \}/);
});
test('no per-element scrollbar overrides or thin default remain', () => {
assert.doesNotMatch(src, /\.apdu-list::-webkit-scrollbar/);
assert.doesNotMatch(src, /\.side-panel::-webkit-scrollbar/);
assert.doesNotMatch(src, /::-webkit-scrollbar \{ width: 6px/);
});
test('the P3 row labels Lc and Le', () => {
assert.match(src, /decoded\.p3_kind === 'le' \? ' · ' \+ t\('Le \(expected response length\)'\)/);
assert.match(src, /t\('Lc \(command data length\)'\)/);
});
// ── trace topbar layout ────────────────────────────────────────────────
test('the view selector sits over the side panel at the panel width', () => {
// one layout variable keeps the two the same width
assert.match(src, /--side-panel-w: 260px;/);
assert.match(src, /\.side-panel \{ width: var\(--side-panel-w\);/);
assert.match(src, /\.trace-topbar \.side-view-select \{ width: var\(--side-panel-w\); flex: 0 0 auto; margin-left: auto; margin-right: -16px; \}/);
// the selector is a topbar control (before the two-column trace area,
// which keeps it visible while the panel scrolls)
const topbar = src.indexOf('<div class="trace-topbar">');
const sel = src.indexOf('id="side-view-select"');
const main = src.indexOf('<div class="trace-main">');
assert.ok(topbar >= 0 && topbar < sel && sel < main, 'selector in the topbar');
});
test('the search input is half its previous width', () => {
assert.match(src, /\.trace-topbar input \{ flex: 0 1 16\.667%;/);
// a long session name ellipsizes rather than wrapping the now tighter row
assert.match(src, /\.trace-topbar #session-name-display \{ white-space: nowrap; overflow: hidden; text-overflow: ellipsis; \}/);
});
test('the header title carries no UICC prefix', () => {
assert.match(src, /<div class="header-title"><a href="https:\/\/osmocom\.org\/projects\/baseband\/wiki\/GSMTAP"/);
assert.doesNotMatch(src, /class="header-title">UICC/);
});