v3.23.5: the TERMINAL RESPONSE result list and its spec corrections

The step editor's result select (the expect's respond, the proactive-drain's
respond/first) offered five symbolic values with no hex.  It now offers the
full TS 102 223 v18.3.0 8.12.0 list (00-3F), labelled '<hex> - <alias>' (or
'<hex> - <spec name>'), plus a manual hex entry, and an optional
additional-information byte for the general result (83 02 <result> <info>,
default 00; the 8.12.2 terminal-problem values are suggested through a
datalist).

The script aliases were corrected to the spec: refused 03->22,
not_understood 04->32, modified 06->07, no_response 22->12 - a stored script
using one of them now answers with the corrected value; no_response stays
accepted for compatibility but is no longer offered by the editor.

The server's TR decode tables (_RESULT_NAMES_BASIC/_GENERAL, a GSM 11.14
mix displayed in the proactive log) are replaced by the spec table plus the
8.12.2 additional-information names; the dcs field parses as hex (0A used to
be refused and 10 read as decimal 10); the drain summary's 22 label is fixed.

The result labels are not translated (spec text); the unused RU keys were
removed.  Shared fixture frontend/tests/tr_results.json, drift-guarded by
both suites.  855 frontend + 838 Python; sw cache simple-v418.
This commit is contained in:
2026-10-07 16:41:53 +03:00
parent cc335def00
commit e0dfc1032e
14 changed files with 627 additions and 86 deletions
+1 -1
View File
@@ -565,7 +565,7 @@
<p class="text-sm mb-2">У вкладки <strong>четыре представления</strong>: <strong>список наборов</strong> (по умолчанию; <em>Добавить набор</em> / <em>Редактировать</em> / <em>Запустить</em> / <em>Экспорт</em> / <em>Удалить</em>), <strong>редактор набора</strong> (скрипты набора в порядке выполнения &mdash; необязательный <em>setup</em> первым и <em>teardown</em> последним, с пометками ролей; у каждого скрипта <em>Запустить</em>/<em>Редактировать</em>/<em>Переместить</em>/<em>Скопировать</em>/<em>Удалить</em>, политика <em>при ошибке</em> <em>остановить</em> (по умолчанию) / <em>продолжить</em> и <em>Требуется ADM</em>), <strong>редактор скрипта</strong> (список шагов; кнопка <em>Старт</em> выполняет только этот скрипт и показывает результат под шагами &mdash; он не сохраняется) и <strong>отчёт набора</strong> (после запуска набора: статус каждого скрипта, таблица шагов с ожидаемым/фактическим, примечание об ошибке и выдержка из журнала запуска; сводка с успешно/предупреждения/ошибки/пропущено, время выполнения, счётчики SCP80 до&nbsp;&rarr;&nbsp;после по каждому keyset, пресет и предупреждение о смене сессии карты; экспорт в <em>JSON</em> или <em>Markdown</em>). <strong>Запуск набора</strong> выполняет его скрипты по порядку в <strong>одной сессии карты, без сбросов и без продолжения с места остановки</strong>; <em>при ошибке</em> решает, остановится ли набор на этом скрипте или запустится следующий, <strong>teardown выполняется всегда</strong> при остановке или ошибке (пока карта в ридере), чтобы следующий тест начался с чистого состояния, а сброс карты останавливает набор и отмечается в отчёте. <strong>Начать со сброса карты</strong> сбрасывает карту и выполняет полную переинициализацию перед запуском набора (скрипты затем работают со свежеинициализированной картой); пресет должен по-прежнему совпадать с ICCID карты, а требуемый ADM проверяется заново для новой сессии карты. Инициализация поглощает начальные proactive-команды карты, поэтому скрипт не поймает первую команду после сброса (они остаются в журнале proactive). <strong>Требуется ADM</strong> (у набора или скрипта) проверяет ключ ADM из подобранного пресета <strong>один раз</strong> перед запуском &mdash; ошибка отклоняет запуск (проверьте вручную через значок ADM; автоматических повторов нет). Скрипты хранятся в хранилище наборов (<code class="font-mono text-sm">~/.pysim-simple-server/test_suites.json</code>, <code class="font-mono text-sm">--test-suites</code>); каждый скрипт принадлежит ровно одному набору, и скрипт можно переместить или скопировать в другой набор (экспорт набора &mdash; это пакет с набором и его скриптами; старый экспорт только скриптов импортируется в автоматически созданный набор &laquo;Imported scripts&raquo;).</p>
<ul class="list-disc list-inside text-sm space-y-1 mb-3">
<li><strong>Действия</strong> &mdash; <em>Envelope</em> (Event Download: сырой тип события + данные, с опциональным переопределением источника &mdash; 82 терминал / 83 сеть) или <em>Event</em> (семантические формы: <strong>та же форма, что и в диалоге отправки на вкладке «Телефон»</strong>, для всех смоделированных событий &mdash; четыре события, которые собирает сервер (Location status, Access technology change, Network rejection, Data connection status change), передаются полями, которые он проверяет и собирает во время запуска, остальные несут собранный формой hex данных события (показывается под формой, с проверкой одного ENVELOPE); источник device identities берётся из события (например, MT call &rarr; сеть) или из его поля источника), <em>Menu Selection</em> (item id 1&ndash;255 или текст пункта с точным/частичным совпадением, по умолчанию без учёта регистра &mdash; выбор <em>«Учёт регистра»</em> в редакторе шагов включает точное совпадение; текст подбирается по меню карты, которое следует за параметрами установки апплета), <em>UPDATE/READ файла</em> (путь + режим; чтение проверяет данные файла), <em>сырой APDU</em> (без авто-обработчика), <em>SCP80</em> (C-APDU или готовый защищённый пакет, опциональные переопределения номера keyset (kvn) / TAR / SPI1 / SPI2 и формат команды &mdash; компактный или обёрнутый в шаблон Command Scripting TS 102 226 &sect;5.2.1 <em>expanded</em> (AA) / <em>expanded AE&nbsp;80</em>; ключи и счётчик берутся из пресета карты, подобранного по ICCID подключённой карты &mdash; запуск называет пресет в хранилище, поэтому всегда используются его keysets, TAR и счётчик &mdash; а сервер сохраняет потреблённый счётчик в пресет по ходу запуска), <em>STATUS</em> (при <em>попытках</em> &gt; 1 опрашивает, пока карта не объявит команду) и <em>Очистка очереди проактивных команд</em> (опрос STATUS и поглощение всех объявленных команд &mdash; результат TERMINAL RESPONSE для каждой, опционально другой результат для первой; граница попыток/интервала; опциональная проверка <em>require</em> по поглощённому. Пустой опрос проходит, финальный STATUS должен быть idle, а оставшаяся команда передаётся следующему шагу &mdash; используйте в начале, середине или конце скрипта, чтобы убедиться, что карта перестала слать команды; она же поглощает команду, оставшуюся от предыдущего шага (ответившего <code class="font-mono text-sm">91XX</code>)). У каждого действия есть проверка ответа: ожидаемые SW и данные (точно или маска с подстановкой <code class="font-mono text-sm">?</code> &mdash; <code class="font-mono text-sm">91??</code>) и проверка PoR для SCP80 (<em>любой / без PoR / por_ok</em> или своя проверка декодированного PoR &mdash; статус / SW / данные; транспорт через SEND SHORT MESSAGE работает так же).</li>
<li><strong>Ожидания</strong> &mdash; карта должна объявить проактивную команду на предыдущем шаге (SW <code class="font-mono text-sm">91XX</code>, TS 102 221 &sect;7.4.2.1 / TS 102 223 &sect;6.3); <code class="font-mono text-sm">9000</code> означает &laquo;команды нет&raquo;: шаг падает на своём уровне ошибок &mdash; Ошибка останавливает скрипт, Предупреждение продолжает (терпимая форма &laquo;поглотить команду, если она есть&raquo;) &mdash; а действие STATUS с <em>попытками</em> &gt; 1 опрашивает, когда апплет выдаёт команду при опросе. Проверяются тип команды, квалификатор и содержимое: текст / пункт / raw, проверка <em>Alpha</em> (идентификатор Alpha команды, тег <code class="font-mono text-sm">05</code>/<code class="font-mono text-sm">85</code> &mdash; отличается от текстовой строки <code class="font-mono text-sm">8D</code>), проверка <em>SMS TPDU</em> (submit-TPDU команды SEND SHORT MESSAGE: получатель / PID / DCS / UDL / данные &mdash; для собственного SMS апплета), проверка <em>PoR</em> (SEND SHORT MESSAGE несёт PoR, когда пакет запросил PoR-in-submit, бит SPI2 <code class="font-mono text-sm">20</code>: статус ответа, SW R-APDU и данные ответа; перед этим должен выполниться шаг SCP80 &mdash; SW R-APDU находится <em>внутри</em> полезной нагрузки ответа: собственный TAR апплета возвращает данные приложения, поэтому проверяйте данные, а SW оставляйте пустым; отклонённый ENVELOPE (<code class="font-mono text-sm">62XX</code>/<code class="font-mono text-sm">63XX</code>) может вовсе не нести пакет ответа &mdash; для такого шага оставляйте проверку PoR «любой» или ожидайте «без PoR») и проверка <em>Files</em> (File List команды REFRESH, например квалификатор <code class="font-mono text-sm">00</code> = NAA initialization with full file change notification). <strong>TERMINAL RESPONSE</strong> (результат, идентификатор пункта, текст, доп. TLV) является частью инструкции.</li>
<li><strong>Ожидания</strong> &mdash; карта должна объявить проактивную команду на предыдущем шаге (SW <code class="font-mono text-sm">91XX</code>, TS 102 221 &sect;7.4.2.1 / TS 102 223 &sect;6.3); <code class="font-mono text-sm">9000</code> означает &laquo;команды нет&raquo;: шаг падает на своём уровне ошибок &mdash; Ошибка останавливает скрипт, Предупреждение продолжает (терпимая форма &laquo;поглотить команду, если она есть&raquo;) &mdash; а действие STATUS с <em>попытками</em> &gt; 1 опрашивает, когда апплет выдаёт команду при опросе. Проверяются тип команды, квалификатор и содержимое: текст / пункт / raw, проверка <em>Alpha</em> (идентификатор Alpha команды, тег <code class="font-mono text-sm">05</code>/<code class="font-mono text-sm">85</code> &mdash; отличается от текстовой строки <code class="font-mono text-sm">8D</code>), проверка <em>SMS TPDU</em> (submit-TPDU команды SEND SHORT MESSAGE: получатель / PID / DCS / UDL / данные &mdash; для собственного SMS апплета), проверка <em>PoR</em> (SEND SHORT MESSAGE несёт PoR, когда пакет запросил PoR-in-submit, бит SPI2 <code class="font-mono text-sm">20</code>: статус ответа, SW R-APDU и данные ответа; перед этим должен выполниться шаг SCP80 &mdash; SW R-APDU находится <em>внутри</em> полезной нагрузки ответа: собственный TAR апплета возвращает данные приложения, поэтому проверяйте данные, а SW оставляйте пустым; отклонённый ENVELOPE (<code class="font-mono text-sm">62XX</code>/<code class="font-mono text-sm">63XX</code>) может вовсе не нести пакет ответа &mdash; для такого шага оставляйте проверку PoR «любой» или ожидайте «без PoR») и проверка <em>Files</em> (File List команды REFRESH, например квалификатор <code class="font-mono text-sm">00</code> = NAA initialization with full file change notification). <strong>TERMINAL RESPONSE</strong> является частью инструкции: поле <strong>результата</strong> предлагает полный список TS 102 223 &sect;8.12.0 (каждая строка подписана <code class="font-mono text-sm">&lt;hex&gt; - &lt;алиас или имя&gt;</code>, плюс ручной ввод hex; алиасы соответствуют спецификации &mdash; <code class="font-mono text-sm">ok</code> 00, <code class="font-mono text-sm">modified</code> 07, <code class="font-mono text-sm">cancel</code> 10, <code class="font-mono text-sm">timeout</code> 12, <code class="font-mono text-sm">refused</code> 22, <code class="font-mono text-sm">not_understood</code> 32, &hellip;), поле <strong>additional information</strong> (дополнительная информация общего результата, по умолчанию <code class="font-mono text-sm">00</code>; предлагаются значения &sect;8.12.2 для проблем терминала), идентификатор пункта, текст (+DCS) и дополнительные TLV.</li>
<li><strong>Уровни ошибок</strong> &mdash; несовпадение помечает шаг как <em>Ошибка</em> (скрипт останавливается) или <em>Предупреждение</em> (продолжает); уровень применяется к любой ошибке шага, включая ожидание без объявленной команды и ошибку карты, возникшую на шаге (например, <code class="font-mono text-sm">6A82</code> отсутствующего необязательного файла); каждая проверка показывается с ожидаемым и фактическим значением.</li>
<li><strong>Шаблоны</strong> &mdash; Empty, <em>Обзор меню STK</em>, <em>Апплет через SCP80</em>; редактор шагов — формный (действие Event показывает форму события из симулятора), а набор экспортируется/импортируется пакетом JSON (набор и его скрипты).</li>
</ul>
+1 -1
View File
@@ -564,7 +564,7 @@
<p class="text-sm mb-2">The pill has <strong>four views</strong>: the <strong>suite list</strong> (default; <em>Add suite</em> / <em>Edit</em> / <em>Run</em> / <em>Export</em> / <em>Delete</em>), the <strong>suite editor</strong> (the suite's scripts in run order &mdash; the optional <em>setup</em> first and the <em>teardown</em> last, marked with role badges; per script <em>Run</em>/<em>Edit</em>/<em>Move</em>/<em>Copy</em>/<em>Delete</em>, the per-member <em>on failure</em> policy <em>stop</em> (default) / <em>continue</em>, and <em>ADM required</em>), the <strong>script editor</strong> (the step list; its <em>Start</em> runs that single script and shows the result under the steps &mdash; not preserved) and the <strong>suite report</strong> (after a suite run: every script's status, its step table with expected/actual, the failing note and a run-log excerpt; the summary with passed/warnings/failed/skipped, wall time, the SCP80 counters before&nbsp;&rarr;&nbsp;after per keyset, the preset and a card-session-changed warning; export as <em>JSON</em> or <em>Markdown</em>). A <strong>suite run</strong> executes its scripts in order in <strong>one card session, without resets and without resume</strong>; <em>on failure</em> decides whether the suite stops at that script or runs the next one, the <strong>teardown always runs</strong> on a stop or a failure (while the card is in the reader) so the next test starts clean, and a card reset stops the suite and is flagged in the report. <strong>Start with card reset</strong> resets the card and runs the full re-initialization before the suite starts (the scripts then run against a freshly initialized card); the preset must still match the card's ICCID afterwards and a required ADM is verified again for the new card session. The initialization consumes the card's initial proactive commands, so a script cannot catch the first command after the reset (they stay in the proactive log). <strong>ADM required</strong> (on the suite or a script) verifies the matched preset's ADM key <strong>once</strong> before the start &mdash; a failure refuses the run (verify manually with the ADM badge; nothing is retried automatically). Scripts live in the suite's store (<code class="font-mono text-sm">~/.pysim-simple-server/test_suites.json</code>, <code class="font-mono text-sm">--test-suites</code>); every script belongs to exactly one suite, and a script can be moved or copied to another suite (a bundle export carries the suite plus its scripts; the old script-only export imports into an auto-created &ldquo;Imported scripts&rdquo; suite).</p>
<ul class="list-disc list-inside text-sm space-y-1 mb-3">
<li><strong>Actions</strong> &mdash; <em>Envelope</em> (Event Download: raw event type + data, with an optional source override &mdash; 82 terminal / 83 network) or <em>Event</em> (the semantic forms: the <strong>same form the Phone tab's send dialog uses</strong>, for every modelled event &mdash; the four events the server builds (Location status, Access technology change, Network rejection, Data connection status change) travel as fields it validates and builds at run time, every other event carries the form's built event-data hex (shown live under the form, with the one-ENVELOPE check); the device-identities source comes from the event (e.g. MT call &rarr; network) or its source field), <em>Menu Selection</em> (item id 1&ndash;255, or the item's text with an exact/contains match, case-insensitive by default &mdash; the step editor's <em>Match case</em> choice switches to an exact-case match; the text is resolved against the card's menu, which follows the applet's install parameters), <em>UPDATE/READ file</em> (path + mode; reads verify the file data), <em>raw APDU</em> (no auto-handler), <em>SCP80</em> (C-APDU or a pre-built secured packet, optional keyset number (kvn) / TAR / SPI1 / SPI2 overrides and a command format &mdash; compact, or the TS 102 226 &sect;5.2.1 Command Scripting template <em>expanded</em> (AA) / <em>expanded AE&nbsp;80</em> around the C-APDU; the keys and the counter come from the card preset matched by the equipped card's ICCID &mdash; the run names the stored preset, so it always uses its keysets, TARs and counter &mdash; the server persists the consumed counter into it as the run proceeds), <em>STATUS</em> (with <em>attempts</em> &gt; 1 it polls until the card announces a command) and <em>Proactive drain</em> (poll STATUS and consume every announced command &mdash; the TERMINAL RESPONSE result for each, optionally a different result for the first; the attempt/interval bound; an optional <em>require</em> assertion over what was drained. An empty poll passes, the final STATUS must be idle, and a still-pending command is handed to the next step &mdash; use it at the start, in the middle or at the end of a script to make sure the card has stopped sending; it also consumes a command a previous step left pending (a step that answered <code class="font-mono text-sm">91XX</code>). Every action has a response check: expected SW and data (exact, or a mask with <code class="font-mono text-sm">?</code> nibble wildcards &mdash; <code class="font-mono text-sm">91??</code>) plus a PoR check for SCP80 (<em>any / no PoR / por_ok</em>, or a custom assertion of the decoded PoR &mdash; status / SW / data; the SEND SHORT MESSAGE transport works the same).</li>
<li><strong>Expectations</strong> &mdash; the card must have announced a proactive command in the previous step (SW <code class="font-mono text-sm">91XX</code>, TS 102 221 &sect;7.4.2.1 / TS 102 223 &sect;6.3); a <code class="font-mono text-sm">9000</code> means &ldquo;no command&rdquo;: the step fails at its fail level &mdash; Error stops the script, Warning continues (the tolerant &ldquo;consume a command if there is one&rdquo; form) &mdash; and a STATUS action with <em>attempts</em> &gt; 1 polls when the applet delivers on poll. The command type, qualifier and contents are verified: text / item / raw checks, an <em>Alpha</em> check (the command's Alpha identifier, tag <code class="font-mono text-sm">05</code>/<code class="font-mono text-sm">85</code> &mdash; distinct from the <code class="font-mono text-sm">8D</code> text string), an <em>SMS TPDU</em> check (the submit TPDU of a SEND SHORT MESSAGE: destination / PID / DCS / UDL / user data &mdash; for an applet's own SMS), a <em>PoR</em> check (a SEND SHORT MESSAGE carries the PoR when the packet requested PoR-in-submit, SPI2 bit <code class="font-mono text-sm">20</code>: the response status, the R-APDU SW and the response data; make sure an SCP80 step ran first &mdash; the R-APDU SW lives <em>inside</em> the response payload: an applet's own TAR returns application data, so check its data and leave the SW empty; a refused ENVELOPE (<code class="font-mono text-sm">62XX</code>/<code class="font-mono text-sm">63XX</code>) may carry no response packet at all &mdash; leave the PoR check at <em>any</em> or expect <em>no PoR</em> for such a step) and a <em>Files</em> check (the File List of a REFRESH, e.g. qualifier <code class="font-mono text-sm">00</code> = NAA initialization with full file change notification). The scripted <strong>TERMINAL RESPONSE</strong> (result, item identifier, text, extra TLVs) is part of the instruction.</li>
<li><strong>Expectations</strong> &mdash; the card must have announced a proactive command in the previous step (SW <code class="font-mono text-sm">91XX</code>, TS 102 221 &sect;7.4.2.1 / TS 102 223 &sect;6.3); a <code class="font-mono text-sm">9000</code> means &ldquo;no command&rdquo;: the step fails at its fail level &mdash; Error stops the script, Warning continues (the tolerant &ldquo;consume a command if there is one&rdquo; form) &mdash; and a STATUS action with <em>attempts</em> &gt; 1 polls when the applet delivers on poll. The command type, qualifier and contents are verified: text / item / raw checks, an <em>Alpha</em> check (the command's Alpha identifier, tag <code class="font-mono text-sm">05</code>/<code class="font-mono text-sm">85</code> &mdash; distinct from the <code class="font-mono text-sm">8D</code> text string), an <em>SMS TPDU</em> check (the submit TPDU of a SEND SHORT MESSAGE: destination / PID / DCS / UDL / user data &mdash; for an applet's own SMS), a <em>PoR</em> check (a SEND SHORT MESSAGE carries the PoR when the packet requested PoR-in-submit, SPI2 bit <code class="font-mono text-sm">20</code>: the response status, the R-APDU SW and the response data; make sure an SCP80 step ran first &mdash; the R-APDU SW lives <em>inside</em> the response payload: an applet's own TAR returns application data, so check its data and leave the SW empty; a refused ENVELOPE (<code class="font-mono text-sm">62XX</code>/<code class="font-mono text-sm">63XX</code>) may carry no response packet at all &mdash; leave the PoR check at <em>any</em> or expect <em>no PoR</em> for such a step) and a <em>Files</em> check (the File List of a REFRESH, e.g. qualifier <code class="font-mono text-sm">00</code> = NAA initialization with full file change notification). The scripted <strong>TERMINAL RESPONSE</strong> is part of the instruction: the <strong>result</strong> offers the full TS 102 223 &sect;8.12.0 list (each entry labelled <code class="font-mono text-sm">&lt;hex&gt; - &lt;alias or name&gt;</code>, plus a manual hex entry; the aliases follow the spec &mdash; <code class="font-mono text-sm">ok</code> 00, <code class="font-mono text-sm">modified</code> 07, <code class="font-mono text-sm">cancel</code> 10, <code class="font-mono text-sm">timeout</code> 12, <code class="font-mono text-sm">refused</code> 22, <code class="font-mono text-sm">not_understood</code> 32, &hellip;), the <strong>additional information</strong> byte of the general result (default <code class="font-mono text-sm">00</code>; the &sect;8.12.2 terminal-problem values are suggested), the item identifier, the text (+DCS) and extra TLVs.</li>
<li><strong>Fail levels</strong> &mdash; a mismatch flags the step as <em>Error</em> (terminates the script) or <em>Warning</em> (continues); every step failure honours it, including an expectation that finds no pending command and a card error raised during the step (an absent optional file's <code class="font-mono text-sm">6A82</code>); each check is reported with expected vs actual values.</li>
<li><strong>Templates</strong> &mdash; Empty, <em>STK menu browsing</em>, <em>Applet via SCP80</em>; the step editor is form-based (the event action renders the Simulator's event form), and a suite exports/imports as a JSON bundle (the suite plus its scripts).</li>
</ul>
+172 -21
View File
@@ -1905,7 +1905,7 @@
// ===== Version =====
// Single source of truth for the PWA version: shown in the header and used
// by the server version check in pysimConnect().
const SIMPLE_VERSION = '3.23.4';
const SIMPLE_VERSION = '3.23.5';
document.getElementById('app-version').textContent = 'v' + SIMPLE_VERSION;
// ===== view history (the browser Back/Forward buttons) =====
@@ -7960,6 +7960,146 @@ function testDeleteStep(i) {
testRenderSteps();
}
// TERMINAL RESPONSE general results (TS 102 223 v18.3.0 8.12.0) and the
// terminal-problem additional information (8.12.2): the step editor offers
// the full list labelled 'hex - alias' (where a script alias exists) or
// 'hex - name', plus a manual hex entry. The values are the spec's; the
// aliases are the authoring convenience. frontend/tests/tr_results.json is
// the fixture both suites drift-guard against.
const TR_RESULTS = [
{v: '00', alias: 'ok', name: 'Command performed successfully'},
{v: '01', alias: 'partial', name: 'Command performed with partial comprehension'},
{v: '02', alias: 'missing', name: 'Command performed, with missing information'},
{v: '03', name: 'REFRESH performed with additional EFs read'},
{v: '04', name: 'Command performed successfully, but requested icon could not be displayed'},
{v: '05', name: 'Command performed, but modified by call control by NAA'},
{v: '06', name: 'Command performed successfully, limited service'},
{v: '07', alias: 'modified', name: 'Command performed with modification'},
{v: '08', name: 'REFRESH performed but indicated NAA was not active'},
{v: '09', name: 'Command performed successfully, tone not played'},
{v: '10', alias: 'cancel', name: 'Proactive UICC session terminated by the user'},
{v: '11', alias: 'back', name: 'Backward move in the proactive UICC session requested by the user'},
{v: '12', alias: 'timeout', name: 'No response from user'},
{v: '13', name: 'Help information required by the user'},
{v: '14', name: 'Reserved for GSM/3G'},
{v: '15', name: 'Reserved for 3GPP (for future usage)'},
{v: '16', name: 'Reserved for 3GPP (for future usage)'},
{v: '20', name: 'Terminal currently unable to process command'},
{v: '21', name: 'Network currently unable to process command'},
{v: '22', alias: 'refused', name: 'User did not accept the proactive command'},
{v: '23', name: 'User cleared down call before connection or network release'},
{v: '24', name: 'Action in contradiction with the current timer state'},
{v: '25', name: 'Interaction with call control by NAA, temporary problem'},
{v: '26', name: 'Launch browser generic error'},
{v: '27', name: 'MMS temporary problem'},
{v: '28', name: 'Reserved for 3GPP (BIP temporary error, T timer in the additional information)'},
{v: '29', name: 'Reserved for 3GPP (for future usage)'},
{v: '30', name: 'Command beyond terminal\'s capabilities'},
{v: '31', name: 'Command type not understood by terminal'},
{v: '32', alias: 'not_understood', name: 'Command data not understood by terminal'},
{v: '33', name: 'Command number not known by terminal'},
{v: '34', name: 'Reserved for GSM/3G'},
{v: '35', name: 'Reserved for GSM/3G'},
{v: '36', name: 'Error, required values are missing'},
{v: '37', name: 'Reserved for GSM/3G'},
{v: '38', name: 'MultipleCard commands error'},
{v: '39', name: 'Interaction with call control by NAA, permanent problem'},
{v: '3A', name: 'Bearer Independent Protocol permanent error'},
{v: '3B', name: 'Access Technology unable to process command'},
{v: '3C', name: 'Frames error'},
{v: '3D', name: 'MMS Error'},
{v: '3E', name: 'Reserved for 3GPP (for future usage)'},
{v: '3F', name: 'Reserved for 3GPP (for future usage)'},
];
const TR_RESULT_ADD_INFO = [
{v: '00', name: 'No specific cause can be given'},
{v: '01', name: 'Screen is busy'},
{v: '02', name: 'Terminal currently busy on call'},
{v: '03', name: 'Reserved for GSM/3G'},
{v: '04', name: 'No service'},
{v: '05', name: 'Access control class bar'},
{v: '06', name: 'Radio resource not granted'},
{v: '07', name: 'Not in speech call'},
{v: '08', name: 'Reserved for GSM/3G'},
{v: '09', name: 'Terminal currently busy on SEND DTMF command'},
{v: '0A', name: 'No NAA active'},
];
// The script authoring aliases (the script may also use the hex value).
// `no_response` is kept for backward compatibility (12) but is not offered
// by the editor - 12's canonical alias is `timeout`.
const TR_RESULT_ALIASES = {
ok: '00', partial: '01', missing: '02', refused: '22', not_understood: '32',
modified: '07', cancel: '10', back: '11', timeout: '12', no_response: '12',
};
// The result select's options: 'hex - alias' where an alias exists, else
// 'hex - spec name', plus a manual hex entry.
function trResultOptions() {
const opts = TR_RESULTS.map(r => ({v: r.alias || r.v, l: r.v + ' - ' + (r.alias || r.name)}));
opts.push({v: 'manual', l: t('manual input')});
return opts;
}
// A stored result -> the select's value and the manual hex ('' unless the
// value is not in the list). Accepts the aliases, the hex and the 0x form.
function trResultFormValue(stored) {
const raw = String(stored === undefined || stored === null ? '' : stored).trim();
if (raw === '') return {value: '', manual: ''};
if (TR_RESULT_ALIASES[raw.toLowerCase()]) return {value: raw.toLowerCase(), manual: ''};
const hex = raw.replace(/^0x/i, '').toUpperCase();
if (/^[0-9A-F]{2}$/.test(hex)) {
const hit = TR_RESULTS.find(r => r.v === hex);
return hit ? {value: hit.alias || hit.v, manual: ''} : {value: 'manual', manual: hex};
}
return {value: 'ok', manual: ''};
}
// A result value is valid when it is an alias or a hex byte.
function trResultValid(v) {
const s = String(v === undefined || v === null ? '' : v).trim().toLowerCase();
return !!TR_RESULT_ALIASES[s] || /^(0x)?[0-9a-f]{2}$/.test(s);
}
// The collected result value of a result select: the selected option's
// alias/hex, or the manual hex entry ('' when empty/invalid -
// testStepFormError reports it). `fallback` is the empty-select default
// (the drain's optional `first` keeps the empty value).
function trResultCollect(selId, hexId, fallback) {
const v = ((document.getElementById(selId) || {}).value || '');
if (v !== 'manual') return v || fallback || '';
return ((document.getElementById(hexId) || {}).value || '').replace(/[^0-9a-fA-F]/g, '').toUpperCase();
}
// Show/hide a result select's manual hex entry.
function testTrResultChanged(sel, wrapId) {
const el = document.getElementById(wrapId);
if (el) el.classList.toggle('hidden', sel.value !== 'manual');
}
// The result row's HTML: the select, its manual hex entry and the optional
// additional-information field (a hex byte; the terminal-problem codings are
// suggested through the datalist).
function trResultRowHtml(selId, stored, addInfo, opts) {
const v = trResultFormValue(stored);
const wrapId = selId + '-hexwrap';
const options = (opts && opts.empty ? [{v: '', l: t(opts.empty)}] : []).concat(trResultOptions());
let html = '<div class="flex gap-2">'
+ testFormSelect(selId, v.value, options, "testTrResultChanged(this, '" + wrapId + "')")
+ '<div id="' + wrapId + '" class="w-24' + (v.value === 'manual' ? '' : ' hidden') + '">'
+ testFormInput(selId + '-hex', v.manual, '00', 'maxlength="2"') + '</div></div>';
const add = addInfo === undefined || addInfo === null || addInfo === '' ? ''
: (typeof addInfo === 'number' ? addInfo.toString(16).toUpperCase().padStart(2, '0') : String(addInfo).toUpperCase());
html += '<div class="mt-1 flex gap-2 items-center"><label class="text-xs text-gray-500 dark:text-slate-400 shrink-0">'
+ esc(t('Additional information (optional hex byte)')) + '</label>'
+ '<div class="w-24">' + testFormInput(selId + '-addinfo', add, '00', 'list="tr-addinfo-list" maxlength="2"') + '</div></div>';
html += '<datalist id="tr-addinfo-list">'
+ TR_RESULT_ADD_INFO.map(a => '<option value="' + esc(a.v) + '">' + esc(a.name) + '</option>').join('')
+ '</datalist>';
return html;
}
function testFormRow(label, inner) {
return '<div><label class="block mb-1 text-xs font-medium text-gray-700 dark:text-slate-300">' + esc(t(label)) + '</label>' + inner + '</div>';
}
@@ -8073,15 +8213,11 @@ function testStepRender() {
} else if (step.kind === 'proactive-drain') {
const pr = p.respond || {};
html += testFormRow('TERMINAL RESPONSE result (each command)',
testFormSelect('test-f-presult', pr.result === undefined ? 'ok' : String(pr.result), [
{v: 'ok', l: t('ok')}, {v: 'cancel', l: t('cancel')}, {v: 'back', l: t('back')},
{v: 'timeout', l: t('timeout')}, {v: 'no_response', l: t('no response')}]));
trResultRowHtml('test-f-presult', pr.result === undefined ? 'ok' : pr.result, pr.additional_info));
const pf = p.first || {};
html += testFormRow('First command only (optional)',
testFormSelect('test-f-pfirst', pf.result === undefined ? '' : String(pf.result), [
{v: '', l: t('same as above')}, {v: 'ok', l: t('ok')}, {v: 'cancel', l: t('cancel')},
{v: 'back', l: t('back')}, {v: 'timeout', l: t('timeout')},
{v: 'no_response', l: t('no response')}]));
trResultRowHtml('test-f-pfirst', pf.result === undefined ? '' : pf.result, pf.additional_info,
{empty: 'same as above'}));
html += testFormRow('Attempts (STATUS rounds)', testFormInput('test-f-pattempts', p.attempts === undefined ? 3 : p.attempts, '1..1000'));
html += testFormRow('Interval (ms, between rounds)', testFormInput('test-f-pinterval', p.interval_ms === undefined ? 200 : p.interval_ms, '0..10000'));
const rq = p.require || {};
@@ -8124,9 +8260,8 @@ function testStepRender() {
+ '<button onclick="testAddCheck()" class="px-2 py-0.5 text-xs rounded border border-gray-300 dark:border-slate-600">' + esc(t('Add check')) + '</button></div>'
+ '<div id="test-checks"></div></div>';
const r = step.respond || {};
html += testFormRow('TERMINAL RESPONSE result', testFormSelect('test-f-result', r.result === undefined ? 'ok' : String(r.result), [
{v: 'ok', l: t('ok')}, {v: 'cancel', l: t('cancel')}, {v: 'back', l: t('back')},
{v: 'timeout', l: t('timeout')}, {v: 'no_response', l: t('no response')}]));
html += testFormRow('TERMINAL RESPONSE result',
trResultRowHtml('test-f-result', r.result === undefined ? 'ok' : r.result, r.additional_info));
html += testFormRow('Item identifier (SELECT ITEM / SET UP MENU)', testFormInput('test-f-ritem', r.item_id, '1..255'));
html += testFormRow('Text (GET INKEY / GET INPUT)', '<div class="flex gap-2">'
+ testFormInput('test-f-rtext', r.text, 'text')
@@ -8406,9 +8541,13 @@ function testStepCollect() {
}
else if (kind === 'status') { p.attempts = num('test-f-attempts', 1); p.interval_ms = num('test-f-interval', 200); }
else if (kind === 'proactive-drain') {
p.respond = {result: val('test-f-presult') || 'ok'};
const first = val('test-f-pfirst');
p.respond = {result: trResultCollect('test-f-presult', 'test-f-presult-hex', 'ok')};
const padd = hexNoMask('test-f-presult-addinfo');
if (padd) p.respond.additional_info = padd;
const first = trResultCollect('test-f-pfirst', 'test-f-pfirst-hex', '');
if (first) p.first = {result: first};
const fadd = hexNoMask('test-f-pfirst-addinfo');
if (fadd && p.first) p.first.additional_info = fadd;
p.attempts = num('test-f-pattempts', 3);
p.interval_ms = num('test-f-pinterval', 200);
const requireCmd = val('test-f-prequire');
@@ -8457,7 +8596,9 @@ function testStepCollect() {
if (c.kind === 'files') return !!(c.files && c.files.length);
return !!(c.value || '').trim();
});
const r = {result: val('test-f-result') || 'ok'};
const r = {result: trResultCollect('test-f-result', 'test-f-result-hex', 'ok')};
const radd = hexNoMask('test-f-result-addinfo');
if (radd) r.additional_info = radd;
const ri = num('test-f-ritem', 0);
if (ri) r.item_id = ri;
const text = val('test-f-rtext');
@@ -8502,9 +8643,19 @@ function testStepFormError() {
}
if ((step.kind === 'file-write' || step.kind === 'file-read') && !p.path) return t('file path is empty');
if (step.kind === 'status' && !(p.attempts >= 1)) return t('attempts must be at least 1');
if (step.kind === 'proactive-drain' && !(p.attempts >= 1)) return t('attempts must be at least 1');
if (step.kind === 'proactive-drain') {
if (!(p.attempts >= 1)) return t('attempts must be at least 1');
if (!trResultValid((p.respond || {}).result)) return t('TERMINAL RESPONSE result must be two hex digits');
const fsel = val('test-f-pfirst');
if (fsel === 'manual' && !/^[0-9A-F]{2}$/.test(hexNoMask('test-f-pfirst-hex'))) {
return t('TERMINAL RESPONSE result must be two hex digits');
}
if (fsel && fsel !== 'manual' && !trResultValid(fsel)) return t('TERMINAL RESPONSE result must be two hex digits');
}
} else if (!step.command) {
return t('command is required');
} else if (!trResultValid((step.respond || {}).result)) {
return t('TERMINAL RESPONSE result must be two hex digits');
}
return '';
}
@@ -16699,7 +16850,9 @@ async function pysimProactiveLogRender() {
if (e.tr_hex !== undefined) {
if (e.tr_result !== undefined) {
html += '<div class="flex gap-1"><span class="text-gray-500 dark:text-slate-400 shrink-0">' + t('Result') + ':</span>'
+ '<span class="break-all">' + (e.tr_result_name ? esc(e.tr_result_name) + ' (' + esc(e.tr_result) + ')' : esc(e.tr_result)) + '</span></div>';
+ '<span class="break-all">' + (e.tr_result_name
? esc(e.tr_result_name) + (e.tr_result_info_name ? ' \u00b7 ' + esc(e.tr_result_info_name) : '') + ' (' + esc(e.tr_result) + ')'
: esc(e.tr_result)) + '</span></div>';
}
if (e.tr_hex) {
html += pysimLogFields(e.tr_decoded);
@@ -22872,11 +23025,9 @@ const LANG_RU = {
'Text': 'Текст',
'id': 'id',
'text': 'текст',
'ok': 'ок',
'cancel': 'отмена',
'back': 'назад',
'timeout': 'тайм-аут',
'no response': 'нет ответа',
'manual input': 'ручной ввод',
'Additional information (optional hex byte)': 'Дополнительная информация (необязательный hex-байт)',
'TERMINAL RESPONSE result must be two hex digits': 'Результат TERMINAL RESPONSE — ровно два hex-символа',
'PoR = por_ok': 'PoR = por_ok',
'event data is required': 'нужны данные события',
'event data must be hex': 'данные события должны быть в hex',
+1 -1
View File
@@ -1,4 +1,4 @@
const CACHE = 'simple-v417';
const CACHE = 'simple-v418';
const URLS = [
'index.html',
'help.html',
+10
View File
@@ -57,6 +57,16 @@ globalThis.testSuites = () => _testSuites || [];
eval(extractFunc(html, 'testFormRow'));
eval(extractFunc(html, 'testFormInput'));
eval(extractFunc(html, 'testFormSelect'));
// the TERMINAL RESPONSE result tables + the shared result-row helpers
eval(extractBlock('const TR_RESULTS = [', 'const TR_RESULT_ADD_INFO = [').replace(/^const /gm, 'var '));
eval(extractBlock('const TR_RESULT_ADD_INFO = [', 'const TR_RESULT_ALIASES = {').replace(/^const /gm, 'var '));
eval(extractBlock('const TR_RESULT_ALIASES = {', 'function trResultOptions').replace(/^const /gm, 'var '));
eval(extractFunc(html, 'trResultOptions'));
eval(extractFunc(html, 'trResultFormValue'));
eval(extractFunc(html, 'trResultValid'));
eval(extractFunc(html, 'trResultCollect'));
eval(extractFunc(html, 'testTrResultChanged'));
eval(extractFunc(html, 'trResultRowHtml'));
eval(extractFunc(html, 'testStepRender'));
eval(extractFunc(html, 'testRenderChecks'));
eval(extractFunc(html, 'testStepCollect'));
+73
View File
@@ -0,0 +1,73 @@
{
"comment": "TERMINAL RESPONSE general results (TS 102 223 v18.3.0 8.12.0) and the terminal-problem additional information (8.12.2). Mirrored by pysim_simple_server/testscript.py (TR_RESULTS/TR_RESULT_ADD_INFO/RESULT_NAMES) and frontend/index.html (the same names); both suites drift-guard against this fixture.",
"results": [
{"v": "00", "name": "Command performed successfully", "alias": "ok"},
{"v": "01", "name": "Command performed with partial comprehension", "alias": "partial"},
{"v": "02", "name": "Command performed, with missing information", "alias": "missing"},
{"v": "03", "name": "REFRESH performed with additional EFs read"},
{"v": "04", "name": "Command performed successfully, but requested icon could not be displayed"},
{"v": "05", "name": "Command performed, but modified by call control by NAA"},
{"v": "06", "name": "Command performed successfully, limited service"},
{"v": "07", "name": "Command performed with modification", "alias": "modified"},
{"v": "08", "name": "REFRESH performed but indicated NAA was not active"},
{"v": "09", "name": "Command performed successfully, tone not played"},
{"v": "10", "name": "Proactive UICC session terminated by the user", "alias": "cancel"},
{"v": "11", "name": "Backward move in the proactive UICC session requested by the user", "alias": "back"},
{"v": "12", "name": "No response from user", "alias": "timeout"},
{"v": "13", "name": "Help information required by the user"},
{"v": "14", "name": "Reserved for GSM/3G"},
{"v": "15", "name": "Reserved for 3GPP (for future usage)"},
{"v": "16", "name": "Reserved for 3GPP (for future usage)"},
{"v": "20", "name": "Terminal currently unable to process command"},
{"v": "21", "name": "Network currently unable to process command"},
{"v": "22", "name": "User did not accept the proactive command", "alias": "refused"},
{"v": "23", "name": "User cleared down call before connection or network release"},
{"v": "24", "name": "Action in contradiction with the current timer state"},
{"v": "25", "name": "Interaction with call control by NAA, temporary problem"},
{"v": "26", "name": "Launch browser generic error"},
{"v": "27", "name": "MMS temporary problem"},
{"v": "28", "name": "Reserved for 3GPP (BIP temporary error, T timer in the additional information)"},
{"v": "29", "name": "Reserved for 3GPP (for future usage)"},
{"v": "30", "name": "Command beyond terminal's capabilities"},
{"v": "31", "name": "Command type not understood by terminal"},
{"v": "32", "name": "Command data not understood by terminal", "alias": "not_understood"},
{"v": "33", "name": "Command number not known by terminal"},
{"v": "34", "name": "Reserved for GSM/3G"},
{"v": "35", "name": "Reserved for GSM/3G"},
{"v": "36", "name": "Error, required values are missing"},
{"v": "37", "name": "Reserved for GSM/3G"},
{"v": "38", "name": "MultipleCard commands error"},
{"v": "39", "name": "Interaction with call control by NAA, permanent problem"},
{"v": "3A", "name": "Bearer Independent Protocol permanent error"},
{"v": "3B", "name": "Access Technology unable to process command"},
{"v": "3C", "name": "Frames error"},
{"v": "3D", "name": "MMS Error"},
{"v": "3E", "name": "Reserved for 3GPP (for future usage)"},
{"v": "3F", "name": "Reserved for 3GPP (for future usage)"}
],
"aliases": {
"ok": "00",
"partial": "01",
"missing": "02",
"refused": "22",
"not_understood": "32",
"modified": "07",
"cancel": "10",
"back": "11",
"timeout": "12",
"no_response": "12"
},
"additional_info": [
{"v": "00", "name": "No specific cause can be given"},
{"v": "01", "name": "Screen is busy"},
{"v": "02", "name": "Terminal currently busy on call"},
{"v": "03", "name": "Reserved for GSM/3G"},
{"v": "04", "name": "No service"},
{"v": "05", "name": "Access control class bar"},
{"v": "06", "name": "Radio resource not granted"},
{"v": "07", "name": "Not in speech call"},
{"v": "08", "name": "Reserved for GSM/3G"},
{"v": "09", "name": "Terminal currently busy on SEND DTMF command"},
{"v": "0A", "name": "No NAA active"}
]
}
+122
View File
@@ -0,0 +1,122 @@
const { test } = require('node:test');
const assert = require('node:assert');
const fs = require('node:fs');
const path = require('node:path');
const html = fs.readFileSync(path.join(__dirname, '..', 'index.html'), 'utf8');
const fixture = JSON.parse(fs.readFileSync(path.join(__dirname, 'tr_results.json'), 'utf8'));
function extractBlock(startMarker, endMarker) {
const start = html.indexOf(startMarker);
const end = html.indexOf(endMarker, start);
if (start < 0 || end < 0) throw new Error('block not found: ' + startMarker);
return html.slice(start, end);
}
function extractFunc(src, name) {
const re = new RegExp('function\\s+' + name + '\\s*\\([^)]*\\)\\s*\\{');
const m = re.exec(src);
if (!m) throw new Error('function ' + name + ' not found');
let i = m.index + m[0].length - 1;
let depth = 0;
for (; i < src.length; i++) {
if (src[i] === '{') depth++;
else if (src[i] === '}') {
depth--;
if (depth === 0) break;
}
}
return src.slice(m.index, i + 1);
}
// Rewrite top-level const -> var so the tables leak out of sloppy-mode eval.
eval(extractBlock('const TR_RESULTS = [', 'const TR_RESULT_ADD_INFO = [').replace(/^const /gm, 'var '));
eval(extractBlock('const TR_RESULT_ADD_INFO = [', 'const TR_RESULT_ALIASES = {').replace(/^const /gm, 'var '));
eval(extractBlock('const TR_RESULT_ALIASES = {', 'function trResultOptions').replace(/^const /gm, 'var '));
eval(extractFunc(html, 'esc'));
eval(extractFunc(html, 'trResultOptions'));
eval(extractFunc(html, 'trResultFormValue'));
eval(extractFunc(html, 'trResultValid'));
eval(extractFunc(html, 'trResultCollect'));
eval(extractFunc(html, 'testTrResultChanged'));
eval(extractFunc(html, 'testFormInput'));
eval(extractFunc(html, 'testFormSelect'));
eval(extractFunc(html, 'trResultRowHtml'));
globalThis.t = s => s;
const fixtureResults = fixture.results.map(r => {
const o = { v: r.v, name: r.name };
if (r.alias) o.alias = r.alias;
return o;
});
test('the PWA result tables match the shared fixture', () => {
assert.deepStrictEqual(TR_RESULTS, fixtureResults);
assert.deepStrictEqual(TR_RESULT_ADD_INFO, fixture.additional_info);
assert.deepStrictEqual(TR_RESULT_ALIASES, fixture.aliases);
});
test('the corrected aliases carry the TS 102 223 8.12.0 values', () => {
assert.strictEqual(TR_RESULT_ALIASES.refused, '22');
assert.strictEqual(TR_RESULT_ALIASES.not_understood, '32');
assert.strictEqual(TR_RESULT_ALIASES.modified, '07');
assert.strictEqual(TR_RESULT_ALIASES.no_response, '12');
assert.strictEqual(TR_RESULT_ALIASES.ok, '00');
});
test('trResultOptions labels every entry with its hex value', () => {
const opts = trResultOptions();
// the full list plus the manual entry
assert.strictEqual(opts.length, TR_RESULTS.length + 1);
assert.deepStrictEqual(opts[0], { v: 'ok', l: '00 - ok' });
const byValue = {};
opts.forEach(o => { byValue[o.v] = o.l; });
assert.strictEqual(byValue.modified, '07 - modified');
assert.strictEqual(byValue['09'], '09 - Command performed successfully, tone not played');
assert.strictEqual(byValue['20'], '20 - Terminal currently unable to process command');
assert.strictEqual(byValue['3F'], '3F - Reserved for 3GPP (for future usage)');
assert.deepStrictEqual(opts[opts.length - 1], { v: 'manual', l: 'manual input' });
// the compat-only alias is not offered (12's canonical alias is timeout)
assert.ok(!('no_response' in byValue), 'no_response must not be an option');
});
test('trResultFormValue maps the stored alias/hex/manual values', () => {
assert.deepStrictEqual(trResultFormValue('ok'), { value: 'ok', manual: '' });
assert.deepStrictEqual(trResultFormValue('OK'), { value: 'ok', manual: '' });
assert.deepStrictEqual(trResultFormValue('07'), { value: 'modified', manual: '' });
assert.deepStrictEqual(trResultFormValue('0x09'), { value: '09', manual: '' });
assert.deepStrictEqual(trResultFormValue('1a'), { value: 'manual', manual: '1A' });
assert.deepStrictEqual(trResultFormValue(''), { value: '', manual: '' });
assert.deepStrictEqual(trResultFormValue(undefined), { value: '', manual: '' });
assert.deepStrictEqual(trResultFormValue('bogus'), { value: 'ok', manual: '' });
});
test('trResultValid accepts the aliases and hex bytes only', () => {
['ok', 'refused', '07', '0x0a', 'FF'].forEach(v => assert.ok(trResultValid(v), v));
['manual', '', 'f', 'zzz'].forEach(v => assert.ok(!trResultValid(v), v));
});
test('the step editor offers the full list for all three result fields', () => {
const form = extractFunc(html, 'testStepRender');
assert.ok(form.includes("trResultRowHtml('test-f-result'"), 'the expectation result');
assert.ok(form.includes("trResultRowHtml('test-f-presult'"), 'the drain result');
assert.ok(form.includes("trResultRowHtml('test-f-pfirst'"), 'the drain first');
assert.ok(form.includes("{empty: 'same as above'}"), 'the first keeps its empty option');
});
test('trResultRowHtml renders the manual entry and the additional info', () => {
const out = trResultRowHtml('test-f-result', '07', '04');
assert.ok(out.includes('07 - modified'), out);
assert.ok(out.includes('value="04"'), out);
assert.ok(out.includes('id="tr-addinfo-list"'), out);
assert.ok(out.includes('No specific cause can be given'), out);
assert.ok(out.includes('id="test-f-result-hexwrap" class="w-24 hidden"'), out);
const manual = trResultRowHtml('test-f-result', '1A', '');
assert.ok(manual.includes('id="test-f-result-hexwrap" class="w-24"'), manual);
assert.ok(manual.includes('value="1A"'), manual);
assert.ok(manual.includes('<option value="manual" selected>'), manual);
// a server-normalised (integer) additional info shows as hex
const intAdd = trResultRowHtml('test-f-result', '07', 10);
assert.ok(intAdd.includes('value="0A"'), intAdd);
});