diff --git a/muxplex/frontend/tests/test_app.mjs b/muxplex/frontend/tests/test_app.mjs index 0ef75e4..548a95a 100644 --- a/muxplex/frontend/tests/test_app.mjs +++ b/muxplex/frontend/tests/test_app.mjs @@ -1622,7 +1622,9 @@ test('renderSheetList uses null check for remoteId (not falsy)', () => { // Must use != null check, not truthy check assert.ok(fnBody.includes('remoteId != null') || fnBody.includes('remoteId !== null'), 'renderSheetList must use null check for remoteId (0 is valid)'); - assert.ok(!fnBody.match(/s\.remoteId\s*\?[^=]/), + // Updated in v0.6.0: regex now excludes ?? (nullish coalescing operator) which is + // not a truthy check — [^?=] rejects both ?? and != forms. + assert.ok(!fnBody.match(/s\.remoteId\s*\?[^?=]/), 'renderSheetList must NOT use truthy check for remoteId (0 is falsy)'); }); @@ -2476,8 +2478,9 @@ test('createNewSession polls for session before auto-opening (not immediate setT // Extract the createNewSession function body const start = source.indexOf('async function createNewSession('); assert.ok(start !== -1, 'createNewSession function must exist'); - // Find the end of the function (next function declaration at same indent level) - const snippet = source.slice(start, start + 2000); + // Updated in v0.6.0: snippet size increased from 2000 to 3500 — function grew with + // loading tile injection and auto-add-to-view logic; setInterval is now ~2800 chars in. + const snippet = source.slice(start, start + 3500); // Must NOT contain the old immediate-open pattern inside createNewSession assert.ok( !snippet.includes("setTimeout(() => openSession"), @@ -2736,6 +2739,9 @@ test('_setGridViewMode and renderGroupedGrid are exported', () => { // --- renderFilterBar (task-12) --- test('renderFilterBar produces pill buttons for each device plus All', () => { + // Updated in v0.6.0: renderFilterBar replaced by Views feature — function is now a no-op + // stub kept for export compatibility. The device filtering UI moved to the view dropdown. + // Test now verifies the stub contract: callable without throwing, does not write to container. const collectedHTML = []; const mockContainer = { get innerHTML() { return collectedHTML[0] || ''; }, @@ -2745,23 +2751,19 @@ test('renderFilterBar produces pill buttons for each device plus All', () => { const sessions = [ { name: 'alpha', deviceName: 'Laptop', sessionKey: 'http://local::alpha', snapshot: '' }, { name: 'beta', deviceName: 'Server', sessionKey: 'http://remote::beta', snapshot: '' }, - { name: 'gamma', deviceName: 'Laptop', sessionKey: 'http://local::gamma', snapshot: '' }, ]; app._setActiveFilterDevice('all'); - app.renderFilterBar(mockContainer, sessions); - - const html = mockContainer.innerHTML; - assert.ok(html.includes('All'), 'filter bar should include an "All" button'); - assert.ok(html.includes('Laptop'), 'filter bar should include a pill for "Laptop"'); - assert.ok(html.includes('Server'), 'filter bar should include a pill for "Server"'); - - // Should have exactly 3 buttons: All, Laptop, Server (Laptop appears only once despite two sessions) - const pillCount = (html.match(/