diff --git a/frontend/js/components/getting-started.js b/frontend/js/components/getting-started.js index bce140e..9d47b5e 100644 --- a/frontend/js/components/getting-started.js +++ b/frontend/js/components/getting-started.js @@ -24,7 +24,12 @@ export function computeSteps({ devices = [], content = [], playlists = [] } = {} const hasPlaylist = playlists.length > 0; // "On screen" is the only step that cannot be faked by creating an object and walking away: // some screen has to actually be pointed at something. - const isAssigned = devices.some((d) => d.playlist_id || d.default_content_id || d.layout_id); + // default_content_id is deliberately NOT counted. No player reads it — grep the whole tree and + // it appears only in this checklist, the device route, the settings snapshot and the schema — + // so counting it ticked "content assigned" for a screen that goes on showing "waiting for + // content". A checklist that lies about the one thing it is there to confirm is worse than no + // checklist. The field itself is left alone; that is a separate decision. + const isAssigned = devices.some((d) => d.playlist_id || d.layout_id); const steps = [ { diff --git a/server/test/getting-started-checklist.test.js b/server/test/getting-started-checklist.test.js index 38ad1ff..71d49d8 100644 --- a/server/test/getting-started-checklist.test.js +++ b/server/test/getting-started-checklist.test.js @@ -61,13 +61,24 @@ test('THE POINT: it is only finished when something is actually ON a screen', as assert.equal(done.nextIndex, -1); }); -test('any of the three ways of assigning counts', async () => { - for (const d of [{ id: 'x', playlist_id: 'p' }, { id: 'x', default_content_id: 'c' }, { id: 'x', layout_id: 'l' }]) { +test('assigning a playlist or a layout counts', async () => { + for (const d of [{ id: 'x', playlist_id: 'p' }, { id: 'x', layout_id: 'l' }]) { const s = GS.computeSteps({ devices: [d], content: [{ id: 'c' }], playlists: [{ id: 'p' }] }); assert.equal(s.complete, true, `${Object.keys(d).join(',')} should count as assigned`); } }); +test('default_content_id does NOT count, because no player reads it', async () => { + // This test previously asserted the opposite, and it was wrong. Grep the whole tree and + // default_content appears only in this checklist, the device form, the settings snapshot, the + // schema and the devices route — never in a socket payload, in assemblePayload, or in any of the + // four players. Setting it changes nothing on the screen, so counting it told the operator + // "content assigned" while their display went on showing "waiting for content". A checklist that + // lies about the one thing it exists to confirm is worse than no checklist. + const s = GS.computeSteps({ devices: [{ id: 'x', default_content_id: 'c' }], content: [{ id: 'c' }], playlists: [{ id: 'p' }] }); + assert.equal(s.complete, false, 'a screen with only default_content is not actually showing anything'); +}); + test('steps stay in dependency order — never sent somewhere unusable', async () => { // Content before a screen exists is not wrong, but it cannot be PUT anywhere, so the next // action must remain the screen.