ui: group the TCP request with the channel/link triggers; identification packet as a same-message follow-up
The Push commands pill now has three sub-pills: Trigger (Push SMS), Store (SD admin params) and Channel / link trigger, which builds all three TS 102 226 §9 establishment requests - 01 BIP channel opening (OPEN CHANNEL), 02 CAT_TP link, 03 TCP connection - with one shared destination-port field and per-request field visibility. The TCP parameters are the OPEN CHANNEL TCP set (BIP, or a direct IP connection per TS 102 483 where supported), so 03 belongs with the other channel/link requests. The identification packet (04) is not a trigger: it presupposes an already open TCP channel and only makes sense as a follow-up in the same message, so it is no longer a standalone request. The TCP request carries an "Also send the identification packet (04) in the same message" checkbox (optional data, ICCID when empty): the preview then shows both commands (a command string sent in one secured packet) and → Expanded Script appends one 22 Command TLV per command. pushSectionApdus() returns the APDU list; 04 stays available in the RAM/GP chain's PUSH row for script sequences. Help 2.7 EN/RU, READMEs and AGENTS describe the three sub-pills and the BIP vs direct-IP nuance; sw cache -> simple-v249; version stays 3.5.0. html.test.js also asserts that the document is complete (ends with </html>, every <script> closed, the inline script parses and defines cApduSwitchSubtab): a truncated index.html made the browser fail to parse the inline script, so every onclick handler reported "function is not defined" while the Node tests still passed.
This commit is contained in:
@@ -134,6 +134,22 @@ test('the C-APDU and R-APDU parsers are sub-pills of the Parser pill', () => {
|
||||
assert.match(html, /id="parser-btn-response" onclick="parserSwitchSubtab\('response'\)"/);
|
||||
});
|
||||
|
||||
test('the document and its inline script are complete', () => {
|
||||
// A truncated index.html (missing </script></body></html>) makes the whole
|
||||
// inline script fail to parse in the browser: every onclick handler then
|
||||
// reports "function is not defined" while the Node tests still pass,
|
||||
// because they extract functions from the text without ever running the
|
||||
// document's script.
|
||||
assert.ok(html.trimEnd().endsWith('</html>'), 'index.html must end with </html>');
|
||||
assert.strictEqual((html.match(/<script\b/g) || []).length,
|
||||
(html.match(/<\/script>/g) || []).length, 'every <script> must be closed');
|
||||
const inline = html.match(/<script>([\s\S]*)<\/script>\s*<\/body>/);
|
||||
assert.ok(inline, 'inline script not found');
|
||||
assert.ok(inline[1].length > 100000, 'inline script looks truncated');
|
||||
new Function(inline[1]); // throws on a syntax error
|
||||
assert.ok(inline[1].includes('function cApduSwitchSubtab'), 'key function missing');
|
||||
});
|
||||
|
||||
test('profiler and phone simulator are top-level tab contents', () => {
|
||||
assert.ok(html.includes('id="tab-profiler" class="tab-content hidden"'));
|
||||
assert.ok(html.includes('id="tab-phone" class="tab-content hidden"'));
|
||||
|
||||
Reference in New Issue
Block a user