create-pmos 0.398.0 → 0.399.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/package.json +13 -13
  2. package/payload/KIT-VERSION +1 -1
  3. package/payload/planning/evals/eval-calibration.md +1 -1
  4. package/payload/planning/okrs/health-budgets.md +1 -1
  5. package/payload/state/discoveries.md +1 -1
  6. package/workspace/briefing-premium-adddoc-test.js +18 -14
  7. package/workspace/briefing-premium-board-test.js +80 -48
  8. package/workspace/briefing-premium-calendar-2-test.js +36 -36
  9. package/workspace/briefing-premium-calendar-3-test.js +39 -39
  10. package/workspace/briefing-premium-calendar-test.js +23 -24
  11. package/workspace/briefing-premium-doc-edit-test.js +6 -2
  12. package/workspace/briefing-premium-initiative-test.js +38 -16
  13. package/workspace/briefing-premium-insights-test.js +114 -37
  14. package/workspace/briefing-premium-metrics-test.js +6 -4
  15. package/workspace/briefing-premium-products-test.js +10 -7
  16. package/workspace/briefing-premium-sources-test.js +25 -22
  17. package/workspace/briefing-premium-test.js +46 -42
  18. package/workspace/briefing-premium-work-test.js +9 -9
  19. package/workspace/changelog.json +12 -0
  20. package/workspace/ev-everywhere-test.js +210 -0
  21. package/workspace/fixtures/premium-viewer-fixtures.js +11 -6
  22. package/workspace/guide/home.md +39 -18
  23. package/workspace/guide/index.md +1 -1
  24. package/workspace/lib/board-grill.js +63 -0
  25. package/workspace/lib/board-premium.js +36 -5
  26. package/workspace/lib/initiative-layout.js +77 -0
  27. package/workspace/lib/insights-premium.js +3 -2
  28. package/workspace/lib/insights-records.js +21 -7
  29. package/workspace/lib/meeting-points.js +52 -0
  30. package/workspace/lib/news-for-you.js +88 -0
  31. package/workspace/lib/notes-series.js +29 -6
  32. package/workspace/lib/report-confirm.js +48 -0
  33. package/workspace/lib/route-modules.js +8 -0
  34. package/workspace/lib/routes-board-docs.js +46 -0
  35. package/workspace/lib/routes-board-grill.js +90 -0
  36. package/workspace/lib/routes-home-review.js +108 -0
  37. package/workspace/lib/routes-initiative-layout.js +57 -0
  38. package/workspace/lib/routes-insights-premium.js +4 -1
  39. package/workspace/lib/routes-insights-records.js +8 -4
  40. package/workspace/lib/routes-meeting-points.js +37 -0
  41. package/workspace/lib/routes-news.js +57 -0
  42. package/workspace/lib/routes-notes.js +2 -1
  43. package/workspace/lib/routes-report-confirm.js +31 -0
  44. package/workspace/lib/routes-search.js +38 -0
  45. package/workspace/lib/search-index.js +176 -0
  46. package/workspace/package-lock.json +2 -2
  47. package/workspace/package.json +1 -1
  48. package/workspace/premium-board-actions-test.js +86 -50
  49. package/workspace/premium-briefing-depth-test.js +55 -54
  50. package/workspace/premium-chat-chart-tab-test.js +4 -2
  51. package/workspace/premium-chat-report-tab-test.js +16 -2
  52. package/workspace/premium-core-doc-issue-test.js +15 -13
  53. package/workspace/premium-phone-card-test.js +5 -3
  54. package/workspace/premium-report-read-test.js +55 -18
  55. package/workspace/premium-vw-backlog-test.js +2 -2
  56. package/workspace/premium-vw-cal-test.js +50 -35
  57. package/workspace/premium-vw-doc-test.js +9 -3
  58. package/workspace/premium-vw-item-test.js +1 -1
  59. package/workspace/premium-vw-jira-test.js +2 -2
  60. package/workspace/premium-vw-meet-test.js +37 -40
  61. package/workspace/premium-vw-notes-test.js +21 -19
  62. package/workspace/premium-vw-rec-test.js +11 -12
  63. package/workspace/premium-welcome-test.js +3 -3
  64. package/workspace/premium-work-depth-test.js +3 -3
  65. package/workspace/public/pm/bd-acts.js +303 -225
  66. package/workspace/public/pm/bd-asks.js +261 -0
  67. package/workspace/public/pm/bd-pop.js +59 -0
  68. package/workspace/public/pm/bd-span.js +49 -13
  69. package/workspace/public/pm/bd-views.js +169 -0
  70. package/workspace/public/pm/cozy-board.css +301 -0
  71. package/workspace/public/pm/cozy-ev.css +228 -0
  72. package/workspace/public/pm/cozy-evmodel.js +106 -0
  73. package/workspace/public/pm/cozy-evui.js +47 -0
  74. package/workspace/public/pm/cozy-insights.css +148 -10
  75. package/workspace/public/pm/cozy-nav.js +103 -39
  76. package/workspace/public/pm/cozy-news.js +140 -0
  77. package/workspace/public/pm/cozy-search.js +203 -0
  78. package/workspace/public/pm/cozy-settings.js +198 -0
  79. package/workspace/public/pm/cozy-sources.js +89 -0
  80. package/workspace/public/pm/cozy-today.css +217 -0
  81. package/workspace/public/pm/cozy-viewer.js +1 -0
  82. package/workspace/public/pm/cozy-vw-mtg.css +350 -0
  83. package/workspace/public/pm/cozy-vw-rp.css +152 -0
  84. package/workspace/public/pm/home-adddoc.js +5 -5
  85. package/workspace/public/pm/home-app.js +329 -55
  86. package/workspace/public/pm/home-around.js +24 -126
  87. package/workspace/public/pm/home-chat.js +67 -14
  88. package/workspace/public/pm/home-data.js +6 -6
  89. package/workspace/public/pm/home-dictate.js +54 -0
  90. package/workspace/public/pm/home-draft.js +6 -6
  91. package/workspace/public/pm/home-ini-model.js +190 -0
  92. package/workspace/public/pm/home-ini.css +171 -0
  93. package/workspace/public/pm/home-ini.js +456 -0
  94. package/workspace/public/pm/home-list.js +276 -0
  95. package/workspace/public/pm/home-more.js +17 -134
  96. package/workspace/public/pm/home-phone-card.js +4 -4
  97. package/workspace/public/pm/home-review.js +104 -0
  98. package/workspace/public/pm/home-task.js +67 -0
  99. package/workspace/public/pm/home-today.js +144 -0
  100. package/workspace/public/pm/home-work.js +54 -26
  101. package/workspace/public/pm/premium-board.js +163 -39
  102. package/workspace/public/pm/premium-chart-tab.js +4 -5
  103. package/workspace/public/pm/premium-first.js +5 -7
  104. package/workspace/public/pm/premium-insights.js +499 -202
  105. package/workspace/public/pm/premium-mtg-present.js +138 -0
  106. package/workspace/public/pm/premium-mtg-replay.js +142 -0
  107. package/workspace/public/pm/premium-report-read.js +216 -52
  108. package/workspace/public/pm/premium-report-tab.js +44 -19
  109. package/workspace/public/pm/premium-shell.js +7 -7
  110. package/workspace/public/pm/premium-vw-cal.js +150 -60
  111. package/workspace/public/pm/premium-vw-mtg.js +488 -261
  112. package/workspace/public/pm/premium-vw-notes.js +61 -0
  113. package/workspace/public/pm/rp-parts.js +269 -0
  114. package/workspace/public/premium-board.html +4 -3
  115. package/workspace/public/premium-insights.html +10 -10
  116. package/workspace/public/premium.html +3 -1
  117. package/workspace/r/m1.png +0 -0
  118. package/workspace/r/m2.png +0 -0
  119. package/workspace/r/m3.png +0 -0
  120. package/workspace/r/nl.png +0 -0
  121. package/workspace/test-lists/initiative-layout.json +9 -0
  122. package/workspace/test-lists/premium-uncovered-meetings.json +9 -0
  123. package/workspace/test-lists/premium-uncovered-reports.json +9 -0
  124. package/workspace/test-lists/uf-everywhere.json +15 -0
  125. package/workspace/test-lists/uf-home.json +9 -0
  126. package/workspace/test-lists/uncovered-board.json +9 -0
@@ -73,33 +73,33 @@ const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'applicati
73
73
  /* M1 add material */
74
74
  const A = await openRail();
75
75
  const p = A.page;
76
- ok('M1 a calendar meeting opens in the Viewer card with + Add material in Prep', A.up, (await text(p)).slice(0, 300));
76
+ ok('M1 a calendar meeting opens in the Viewer card with + Add material in Prep', A.up, (await text(p)).slice(0, 300) + ' ERR ' + A.errors.join('|'));
77
77
  if (!A.up) return finish(1);
78
78
  ok('M2 the material is listed with the scope it was linked at', await until(async () => /Rail PRD/.test(await text(p)) && /every meeting of the series/.test(await text(p)) && /For The report panel/.test(await text(p))), (await text(p)).slice(0, 600));
79
79
  await tap(p, '[data-a="addmat"]');
80
- ok('M1 the sheet opens in the card, marked Waiting for design, with what is linked, Find in PMOS and Or paste a link', await until(() => p.evaluate(() => !!document.querySelector('#czViewer [data-cz-placeholder="Add material"]') && !!document.querySelector('#czViewer [data-f="q"]') && !!document.querySelector('#czViewer [data-f="url"]') && document.querySelectorAll('#czViewer [data-f="rm"]').length === 2)));
80
+ // premium-uncovered-features (meetings, MtMaterial): Add material is a popover under the list; each linked row keeps its own Remove
81
+ ok('M1 Add material opens its popover with Find in PMOS and Paste a link, under the linked rows and their Remove', await until(() => p.evaluate(() => !!document.querySelector('#czViewer .vzm-pop[aria-label="Add material"]') && !!document.querySelector('#czViewer [data-a="matq"]') && !!document.querySelector('#czViewer [data-a="matlink"]') && document.querySelectorAll('#czViewer [data-a="matrm"]').length === 2 && !document.querySelector('#czViewer [data-cz-placeholder]'))));
81
82
  ok('M1 the sheet says the invite is not changed', /The invite in your calendar is not changed/.test(await text(p)));
82
83
  ok('M1 Suggested asks for the level of this meeting and shows what it returned', await until(async () => A.sugg.includes('') && /Rail brief/.test(await text(p))), JSON.stringify(A.sugg));
83
- await p.fill('#czViewer [data-f="q"]', 'p');
84
+ await p.fill('#czViewer [data-a="matq"]', 'p');
84
85
  await p.waitForTimeout(400); // the search waits 220 ms after typing stops; a one-letter search must not ask
85
86
  ok('M1 a one-letter search asks for nothing', !A.sugg.includes('p'), JSON.stringify(A.sugg));
86
- await p.fill('#czViewer [data-f="q"]', 'partner');
87
+ await p.fill('#czViewer [data-a="matq"]', 'partner');
87
88
  ok('M1 Find in PMOS shows what the search returned', await until(async () => A.sugg.includes('partner') && /Partner review/.test(await text(p))), JSON.stringify(A.sugg));
88
- await p.fill('#czViewer [data-f="url"]', 'http://x.example/plain');
89
- await tap(p, '[data-f="addurl"]');
89
+ await p.fill('#czViewer [data-a="matlink"]', 'http://x.example/plain');
90
+ await p.press('#czViewer [data-a="matlink"]', 'Enter');
90
91
  ok('M1 an address that is not https says so and is not added', await until(async () => /Only an https link can be added/.test(await text(p))) && posted(A.S, '/api/meeting-material').length === 0);
91
- ok('M3 the sheet offers a topic of the meeting', await until(() => p.evaluate(() => { const s = document.querySelector('#czViewer [data-f="topic"]'); return s && [...s.options].map((o) => o.textContent).join('|') === 'For the whole meeting|For Rail placement|For Phone layout'; })));
92
- await p.selectOption('#czViewer [data-f="topic"]', 'Rail placement');
93
- await p.check('#czViewer [data-f="series"]');
94
- await p.click('#czViewer [data-f="pick"]');
92
+ ok('M3 the sheet offers a topic of the meeting', await until(() => p.evaluate(() => { const s = document.querySelector('#czViewer [data-a="mattopic"]'); return s && [...s.options].map((o) => o.textContent).join('|') === 'For the whole meeting|For Rail placement|For Phone layout'; })));
93
+ await p.selectOption('#czViewer [data-a="mattopic"]', 'Rail placement');
94
+ await p.check('#czViewer [data-a="matser"]');
95
+ await p.click('#czViewer [data-a="matadd"]');
95
96
  const add = await until(() => posted(A.S, '/api/meeting-material')[0]);
96
97
  ok('M1 Add posts one line to /api/meeting-material for the series, with the topic', add && add.body.op === 'add' && add.body.scope === 'series' && add.body.topic === 'Rail placement' && add.body.event.id === 'ev-rail' && add.body.item.ref === 'reports/partner-review/2026-10-12.md', JSON.stringify(add && add.body));
97
- ok('M3 the list is read again and shows the new row, and the status says what was added', await until(async () => /Partner review/.test(await text(p)) && /Added “Partner review” for every meeting of the series\./.test(await text(p)) && !(await p.$('#czViewer [data-cz-placeholder="Add material"]'))), (await text(p)).slice(0, 500));
98
+ ok('M3 the list is read again and shows the new row, and the status says what was added', await until(async () => /Partner review/.test(await text(p)) && /Added “Partner review” for every meeting of the series\./.test(await text(p)) && !(await p.$('#czViewer .vzm-pop'))), (await text(p)).slice(0, 500));
98
99
 
99
100
  /* M2 remove, then Undo */
100
- await tap(p, '[data-a="addmat"]');
101
- await until(() => p.evaluate(() => document.querySelectorAll('#czViewer [data-f="rm"]').length === 3));
102
- await p.click('#czViewer [data-f="rm"][aria-label="Remove Rail PRD"]');
101
+ await until(() => p.evaluate(() => document.querySelectorAll('#czViewer [data-a="matrm"]').length === 3));
102
+ await p.click('#czViewer [data-a="matrm"][aria-label="Remove Rail PRD"]');
103
103
  const rm = await until(() => posted(A.S, '/api/meeting-material').find((x) => x.body.op === 'remove'));
104
104
  ok('M2 Remove posts the item at the scope it was added', rm && rm.body.scope === 'series' && rm.body.item.ref === 'planning/prd/rail.md', JSON.stringify(rm && rm.body));
105
105
  ok('M2 the row leaves after the list is read again, and the status offers Undo', await until(async () => !/Rail PRD/.test((await text(p)).replace(/Removed “Rail PRD”\./, '')) && !!(await p.$('#czViewer [data-a="msgundo"]'))), (await text(p)).slice(0, 500));
@@ -110,16 +110,17 @@ const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'applicati
110
110
 
111
111
  /* M5 refused writes */
112
112
  A.refuse = 'the material store is busy';
113
- await tap(p, '[data-a="addmat"]');
114
- await until(() => p.evaluate(() => document.querySelectorAll('#czViewer [data-f="rm"]').length > 0));
113
+ await until(() => p.evaluate(() => document.querySelectorAll('#czViewer [data-a="matrm"]').length > 0));
115
114
  const n0 = A.mat.length;
116
- await p.click('#czViewer [data-f="rm"]');
117
- ok('M5 a refused Remove shows the reason, and the sheet stays', await until(async () => /Not removed: the material store is busy/.test(await text(p)) && !!(await p.$('#czViewer [data-cz-placeholder="Add material"]'))));
118
- await p.fill('#czViewer [data-f="url"]', 'https://x.example/notes');
119
- await tap(p, '[data-f="addurl"]');
120
- ok('M5 a refused Add shows the reason, keeps the sheet and what was typed', await until(async () => /Not added: the material store is busy/.test(await text(p)) && (await p.inputValue('#czViewer [data-f="url"]')) === 'https://x.example/notes'));
115
+ await p.click('#czViewer [data-a="matrm"]');
116
+ ok('M5 a refused Remove shows the reason, and the row stays', await until(async () => /Not removed: the material store is busy/.test(await text(p))) && await p.evaluate((n) => document.querySelectorAll('#czViewer [data-a="matrm"]').length === n, n0));
117
+ await tap(p, '[data-a="addmat"]');
118
+ await until(() => p.evaluate(() => !!document.querySelector('#czViewer [data-a="matlink"]')));
119
+ await p.fill('#czViewer [data-a="matlink"]', 'https://x.example/notes');
120
+ await p.press('#czViewer [data-a="matlink"]', 'Enter');
121
+ ok('M5 a refused Add shows the reason, keeps the popover and what was typed', await until(async () => /Not added: the material store is busy/.test(await text(p)) && (await p.inputValue('#czViewer [data-a="matlink"]')) === 'https://x.example/notes'));
121
122
  A.refuse = '';
122
- await tap(p, '[data-f="addurl"]');
123
+ await p.press('#czViewer [data-a="matlink"]', 'Enter');
123
124
  ok('M5 it can be pressed again', await until(() => A.mat.some((m) => m.url === 'https://x.example/notes')) && A.mat.length === n0 + 1);
124
125
  const mats = [...new Set(A.S.posts.map((x) => x.path))];
125
126
  ok('M6 the material work wrote only to /api/meeting-material', mats.join() === '/api/meeting-material', mats.join());
@@ -130,27 +131,26 @@ const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'applicati
130
131
  const B = await F.open(browser, BASE, '/premium-viewer.html?open=meeting&note=n1', { noLive: true });
131
132
  ALL.push(B);
132
133
  const q = B.page;
133
- await until(() => q.evaluate(() => !!document.querySelector('#czViewer [data-a="task"]')), 15000);
134
- ok('M4 each next step has Make task, and decisions and questions have none', await q.evaluate(() => document.querySelectorAll('#czViewer [data-a="task"]').length === 3));
135
- await tap(q, '[data-a="task"][data-i="0"]');
134
+ await until(() => q.evaluate(() => !!document.querySelector('#czViewer [data-a="maketask"]')), 15000);
135
+ ok('M4 each next step has Make task, and decisions and questions have none', await q.evaluate(() => document.querySelectorAll('#czViewer [data-a="maketask"]').length === 3));
136
136
  await tap(q, '[data-a="maketask"][data-i="0"]');
137
137
  const pl = await until(() => posted(B.S, '/api/plan-items')[0]);
138
138
  const ev = pl && pl.body.events && pl.body.events[0];
139
139
  ok('M4 Make task posts one planned event in the first stage with the owner', ev && ev.ev === 'planned' && ev.initiative === 'viewer' && ev.stage === 'st1' && ev.owner === 'person:Ana' && ev.title === 'Add a print view for documents' && pl.body.ws === 'w1', JSON.stringify(pl && pl.body));
140
- ok('M4 the status says where it went, with Undo', await until(async () => /Added to Viewer, under Intake/.test(await text(q)) && !!(await q.$('#czViewer [data-a="msgundo"]'))));
141
- await tap(q, '[data-a="msgundo"]');
140
+ ok('M4 the step says where it went (MtAfter: Task made · added to Viewer, under Intake), with Undo', await until(async () => /Task made · added to Viewer, under Intake/.test(await text(q)) && !!(await q.$('#czViewer [data-a="madeundo"][data-i="0"]'))));
141
+ await tap(q, '[data-a="madeundo"][data-i="0"]');
142
142
  const wd = await until(() => posted(B.S, '/api/plan-items')[1]);
143
143
  ok('M4 Undo withdraws the item', wd && wd.body.events[0].ev === 'withdrawn' && wd.body.events[0].item === 'item-9', JSON.stringify(wd && wd.body));
144
- ok('M4 after Undo the step can be made a task again', await until(async () => /The task is withdrawn/.test(await text(q)) && !!(await q.$('#czViewer [data-a="task"][data-i="0"]'))));
144
+ ok('M4 after Undo the step can be made a task again', await until(async () => /The task is withdrawn/.test(await text(q)) && !!(await q.$('#czViewer [data-a="maketask"][data-i="0"]'))));
145
145
  /* an initiative with no stage; a refused write */
146
146
  await q.route('**/api/plan-items*', (r) => (r.request().method() === 'POST' ? (B.S.posts.push({ path: '/api/plan-items', body: JSON.parse(r.request().postData() || '{}') }), json(r, { ok: false, error: 'the plan is locked' }, 409)) : json(r, { ok: true, stages: B.noStage ? [] : [{ id: 'st1', label: 'Intake' }] })));
147
147
  B.noStage = true;
148
148
  const before = posted(B.S, '/api/plan-items').length;
149
- await tap(q, '[data-a="task"][data-i="1"]'); await tap(q, '[data-a="maketask"][data-i="1"]');
149
+ await tap(q, '[data-a="maketask"][data-i="1"]');
150
150
  ok('M4 an initiative with no stage says so and writes nothing', await until(async () => /The initiative has no stage to put the step in/.test(await text(q))) && posted(B.S, '/api/plan-items').length === before);
151
151
  B.noStage = false;
152
- await tap(q, '[data-a="task"][data-i="1"]'); await tap(q, '[data-a="maketask"][data-i="1"]');
153
- ok('M5 a refused Make task shows the reason and the step stays open', await until(async () => /The task was not made: the plan is locked/.test(await text(q))) && !!(await q.$('#czViewer [data-a="task"][data-i="1"]')));
152
+ await tap(q, '[data-a="maketask"][data-i="1"]');
153
+ ok('M5 a refused Make task shows the reason and the step stays open', await until(async () => /The task was not made: the plan is locked/.test(await text(q))) && !!(await q.$('#czViewer [data-a="maketask"][data-i="1"]')));
154
154
  await B.ctx.close();
155
155
 
156
156
  /* M4 a note with no initiative */
@@ -158,17 +158,17 @@ const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'applicati
158
158
  ALL.push(C);
159
159
  await C.page.route('**/api/notes/one*', (r) => json(r, { ok: true, note: { ...W.NOTE, initiative: null, series: null }, place: null }));
160
160
  await C.page.reload();
161
- await until(() => C.page.evaluate(() => !!document.querySelector('#czViewer [data-a="task"]')), 15000);
162
- await tap(C.page, '[data-a="task"][data-i="0"]'); await tap(C.page, '[data-a="maketask"][data-i="0"]');
163
- ok('M4 with no initiative the press says to link one and writes nothing', await until(async () => /Link the note to an initiative first/.test(await text(C.page))) && posted(C.S, '/api/plan-items').length === 0);
161
+ await until(() => C.page.evaluate(() => !!document.querySelector('#czViewer [data-a="maketask"]')), 15000);
162
+ await tap(C.page, '[data-a="maketask"][data-i="0"]');
163
+ ok('M4 with no initiative the press says to link one and writes nothing', await until(async () => /link the meeting to an initiative first/i.test(await text(C.page))) && posted(C.S, '/api/plan-items').length === 0);
164
164
  await C.ctx.close();
165
165
 
166
166
  /* M7 floors */
167
167
  const D = await openRail({ w: 390, h: 844 });
168
168
  await tap(D.page, '[data-a="addmat"]');
169
- await until(() => D.page.evaluate(() => !!document.querySelector('#czViewer [data-f="url"]')));
169
+ await until(() => D.page.evaluate(() => !!document.querySelector('#czViewer [data-a="matlink"]')));
170
170
  const fl = await D.page.evaluate(() => ({ over: document.documentElement.scrollWidth - innerWidth }));
171
- ok('M7 at 390 px the sheet has no sideways scroll', fl.over <= 0, JSON.stringify(fl));
171
+ ok('M7 at 390 px the popover has no sideways scroll', fl.over <= 0, JSON.stringify(fl));
172
172
  await D.ctx.close();
173
173
  ok('M6 no page error in any run', ALL.every((x) => x.errors.length === 0), JSON.stringify(ALL.map((x) => x.errors).filter((e) => e.length)));
174
174
  return finish();
@@ -7,7 +7,8 @@
7
7
  * makes the same requests the console's recorder makes (record, pause, stop) and opens no microphone.
8
8
  * Focus and the full Replay view have no design in the Agreed mockup: they are the plain versions, marked "Waiting for design". The topic of an
9
9
  * added item (R8) is in briefing-premium-calendar-2-test.js (M3).
10
- * R1 record · R2 honest state · R3 no chip · R4 leaving · R5 Focus · R6 honest Focus · R7 Replay · R10 writes · R11 floors · R12 full Replay
10
+ * R1 record · R2 honest state · R3 no chip · R4 leaving · R5 Focus · R6 honest Focus · R7 Replay · R10 writes · R11 floors · R12 every line
11
+ * (premium-uncovered-features, meetings: Focus and Replay are tabs of the card, the recording is one line in its head, MtFocus and MtReplay)
11
12
  * Every wait polls the page; no fixed sleep stands in for a state. */
12
13
  const path = require('path');
13
14
  const { spawn } = require('child_process');
@@ -42,7 +43,7 @@ const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'applicati
42
43
  const tap = (p, sel) => p.$eval('#czViewer ' + sel, (b) => b.click());
43
44
  const text = (p) => p.evaluate(() => (document.querySelector('#czViewer') || {}).innerText || '');
44
45
  const notesPosts = (S) => S.posts.filter((x) => x.path.startsWith('/api/notes/')).map((x) => x.path.replace('/api/notes/', ''));
45
- const chip = (p) => p.evaluate(() => (document.querySelector('#czViewer .vz-chip') || {}).textContent || '');
46
+ const chip = (p) => p.evaluate(() => (document.querySelector('#czViewer .vzm-state') || {}).textContent || '');
46
47
  const LIVE_URL = '/premium-viewer.html?open=meeting&event=ev-live&date=' + F.dayKey(W.LIVE);
47
48
  const ALL = [];
48
49
  const open = async (url, o) => { const X = await F.open(browser, BASE, url, { noLive: true, ...o }); ALL.push(X); return X; };
@@ -50,7 +51,7 @@ const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'applicati
50
51
  /* R1 record */
51
52
  const A = await open(LIVE_URL);
52
53
  const p = A.page;
53
- ok('R1 a meeting under way has Record', await until(() => p.evaluate(() => (document.querySelector('#czViewer .vz-pri') || {}).dataset && document.querySelector('#czViewer .vz-pri').dataset.k === 'record'), 15000));
54
+ ok('R1 a meeting under way has Record', await until(() => p.evaluate(() => !!document.querySelector('#czViewer .vzm-hc [data-a="record"]')), 15000));
54
55
  await tap(p, '[data-a="more"]'); await tap(p, '[data-a="m-why"]');
55
56
  ok('R1 More says what Record and Focus do', await until(async () => /stay on this machine|on this machine/i.test(await text(p)) && !!(await p.$('#czViewer .vz-why'))), (await text(p)).slice(0, 400));
56
57
  ok('R1 nothing was sent to the notes routes before a press', notesPosts(A.S).length === 0);
@@ -62,14 +63,14 @@ const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'applicati
62
63
  await tap(p, '[data-a="recgo"]');
63
64
  const made = await until(() => A.S.posts.find((x) => x.path === '/api/notes/new'));
64
65
  ok('R1 "I told them, start" makes the note for the calendar event, then listens on it', made && JSON.stringify(made.body).includes('ev-live') && await until(() => notesPosts(A.S).join() === 'new,record'), JSON.stringify(made && made.body));
65
- ok('R2 the card says Recording, with the clock and Stop', await until(async () => (await chip(p)) === 'Recording' && !!(await p.$('#czViewer .vz-pri[data-k="stop"]'))));
66
+ ok('R2 the card says Recording, with the clock and Stop', await until(async () => (await chip(p)) === 'Recording' && /Recording · \d{2}:\d{2}/.test(await text(p)) && !!(await p.$('#czViewer .vzm-rec [data-a="stop"]'))));
66
67
  ok('R3 no floating record chip is drawn while it records', !(await p.$('#recChip, #recCtl')));
67
68
 
68
69
  /* R2 pause and resume */
69
- await tap(p, '.vz-bar [data-a="pause"]');
70
- ok('R2 Pause pauses through the route and the card says Paused with Resume', await until(async () => (await chip(p)) === 'Paused' && !!(await p.$('#czViewer .vz-pri[data-k="resume"]'))));
70
+ await tap(p, '.vzm-rec [data-a="pause"]');
71
+ ok('R2 Pause pauses through the route and the card says Paused with Resume', await until(async () => (await chip(p)) === 'Paused' && /Recording paused at \d{2}:\d{2} · nothing is kept while paused/.test(await text(p)) && !!(await p.$('#czViewer .vzm-rec [data-a="resume"]'))));
71
72
  ok('R3 no record chip while it is paused either', !(await p.$('#recChip, #recCtl')));
72
- await tap(p, '.vz-pri[data-k="resume"]');
73
+ await tap(p, '.vzm-rec [data-a="resume"]');
73
74
  ok('R2 Resume listens again on the same note, without asking for consent twice', await until(() => notesPosts(A.S).join() === 'new,record,pause,record') && !/Tell everyone first/.test(await text(p)));
74
75
 
75
76
  /* R4 leaving while it records */
@@ -80,12 +81,12 @@ const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'applicati
80
81
  ok('R4 leaving the page while it records makes the browser ask first, and staying pauses nothing', await until(() => dialog === 'beforeunload') && notesPosts(A.S).join() === 'new,record,pause,record', String(dialog));
81
82
 
82
83
  /* R1 stop */
83
- await until(() => p.evaluate(() => !!document.querySelector('#czViewer .vz-pri[data-k="stop"]')));
84
- await tap(p, '.vz-pri[data-k="stop"]');
84
+ await until(() => p.evaluate(() => !!document.querySelector('#czViewer .vzm-rec [data-a="stop"]')));
85
+ await tap(p, '.vzm-rec [data-a="stop"]');
85
86
  ok('R1 Stop asks first', await until(async () => /Stop for good/.test(await text(p))));
86
87
  await tap(p, '[data-a="askno"]');
87
88
  ok('R1 Not yet on the ask stops nothing', await until(async () => !/Stop for good/.test(await text(p))) && !notesPosts(A.S).includes('stop'));
88
- await tap(p, '.vz-pri[data-k="stop"]');
89
+ await tap(p, '.vzm-rec [data-a="stop"]');
89
90
  await tap(p, '[data-a="stopgo"]');
90
91
  ok('R1 Stop for good ends the meeting through the route, and the card says so', await until(async () => notesPosts(A.S).includes('stop') && /Stopped\. The final notes are written now/.test(await text(p))));
91
92
  ok('R10 the notes writes sent were new, record, pause, record, stop and nothing else', notesPosts(A.S).join() === 'new,record,pause,record,stop', notesPosts(A.S).join());
@@ -122,51 +123,50 @@ const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'applicati
122
123
  /* R5 Focus */
123
124
  const B = await open('/premium-viewer.html?open=meeting&note=n2', { noLive: false, init: () => { window.__premiumHolding = { id: 'n2' }; } });
124
125
  const q = B.page;
125
- await until(() => q.evaluate(() => !!document.querySelector('#czViewer [data-a="more"]')), 15000);
126
- await tap(q, '[data-a="more"]'); await tap(q, '[data-a="m-focus"]');
127
- ok('R5 Focus opens its plain view, marked Waiting for design: the state, the topic now, the topics and the counts', await until(async () => { const t = await text(q); return !!(await q.$('#czViewer [data-cz-placeholder="Focus"]')) && /Now\s+The Issue button/.test(t) && /One toolbar row/.test(t) && /Phone layout/.test(t) && /Captured: 1 decisions · 2 next steps · 0 questions/.test(t); }), (await text(q)).slice(0, 600));
126
+ await until(() => q.evaluate(() => !!document.querySelector('#czViewer [data-a="tab"][data-k="focus"]')), 15000);
127
+ await tap(q, '[data-a="tab"][data-k="focus"]'); // premium-uncovered-features (meetings, MtFocus): Focus is a tab of the live meeting
128
+ ok('R5 Focus: Now · topic 2 of 3, the topic, and the agenda with the minutes used', await until(async () => { const t = await text(q); return /Now · topic 2 of 3/.test(t) && /The Issue button/.test(t) && /One toolbar row/.test(t) && /Phone layout/.test(t) && /\d+ of 10/.test(t) && !(await q.$('#czViewer [data-cz-placeholder]')); }), (await text(q)).slice(0, 600));
128
129
  const f0 = B.S.gets.filter((g) => g.startsWith('/api/meeting-focus')).length;
129
- ok('R5 Focus reads again every 3 seconds while it is open', await until(() => B.S.gets.filter((g) => g.startsWith('/api/meeting-focus')).length >= f0 + 2, 9000));
130
- await q.$eval('#czViewer [data-f="topic"][data-t="Phone layout"]', (b) => b.click());
130
+ ok('R5 Focus reads again while the meeting is live', await until(() => B.S.gets.filter((g) => g.startsWith('/api/meeting-focus')).length >= f0 + 2, 12000));
131
+ await tap(q, '[data-a="topic"]');
132
+ await until(() => q.evaluate(() => !!document.querySelector('#czViewer [data-a="topicgo"]')));
133
+ await q.$eval('#czViewer [data-a="topicgo"][data-i="2"]', (b) => b.click());
131
134
  const tp = await until(() => B.S.posts.find((x) => x.path === '/api/meeting-focus/topic'));
132
- ok('R5 Make it the topic posts one set for that topic on this meeting', tp && tp.body.event === 'ev-live' && tp.body.action === 'set' && tp.body.topic === 'Phone layout', JSON.stringify(B.S.posts) + (await text(q)).slice(0, 300));
133
- await tap(q, '[data-a="back"]');
134
- const f1 = B.S.gets.filter((g) => g.startsWith('/api/meeting-focus')).length;
135
- await q.waitForTimeout(3500); // one Focus period: no read may follow once Focus is left
136
- ok('R5 leaving Focus stops its reads', B.S.gets.filter((g) => g.startsWith('/api/meeting-focus')).length <= f1 + 1, String(B.S.gets.filter((g) => g.startsWith('/api/meeting-focus')).length - f1));
135
+ ok('R5 Change topic posts one set for that topic on this meeting', tp && tp.body.event === 'ev-live' && tp.body.action === 'set' && tp.body.topic === 'Phone layout', JSON.stringify(B.S.posts) + (await text(q)).slice(0, 300));
137
136
  /* R6 a refused read */
138
137
  await q.route('**/api/meeting-focus?*', (r) => json(r, { ok: false, error: 'the companion is off' }, 503));
139
- await tap(q, '[data-a="more"]'); await tap(q, '[data-a="m-focus"]');
140
- ok('R6 a refused read says why and shows nothing else', await until(async () => /Focus could not read this meeting/.test(await text(q)) && !(await q.$('#czViewer [data-f="topic"]'))), (await text(q)).slice(0, 400));
138
+ ok('R6 a refused read says why and offers no topic to change', await until(async () => /Focus could not read this meeting/.test(await text(q)) && !(await q.$('#czViewer [data-a="topic"]')), 12000), (await text(q)).slice(0, 400));
141
139
  await B.ctx.close();
142
140
 
143
141
  /* R7 Replay */
144
142
  const C = await open('/premium-viewer.html?open=meeting&note=n1');
145
143
  const r = C.page;
146
- ok('R7 a kept recording has Replay', await until(() => r.evaluate(() => !!document.querySelector('#czViewer [data-a="replay"]')), 15000));
147
- await tap(r, '[data-a="replay"]');
148
- ok('R7 Replay opens the notes with the track and plays', await until(() => r.evaluate(() => !!document.querySelector('#czViewer .vz-trk') && document.querySelector('#czViewer [data-a="play"]').dataset.on === 'true')));
149
- const pos = () => r.evaluate(() => (document.querySelector('#czViewer [data-clk="pos"]') || {}).textContent || '');
144
+ ok('R7 a kept recording has the Replay tab', await until(() => r.evaluate(() => !!document.querySelector('#czViewer [data-a="tab"][data-k="replay"]')), 15000));
145
+ await tap(r, '[data-a="tab"][data-k="replay"]');
146
+ const playing = () => r.evaluate(() => /^Pause/.test((document.querySelector('#czViewer .vzp-dt [data-a="play"]') || { getAttribute: () => '' }).getAttribute('aria-label') || ''));
147
+ ok('R7 Replay shows the player, the strip and the kept points (MtReplay)', await until(() => r.evaluate(() => !!document.querySelector('#czViewer .vzp-dt .vzp-strip') && document.querySelectorAll('#czViewer .vzp-kr').length > 0)));
148
+ await tap(r, '.vzp-dt [data-a="play"]');
149
+ ok('R7 Play plays', await until(playing));
150
+ const pos = () => r.evaluate(() => (document.querySelector('#czViewer .vzp-dt [data-clk="pos"]') || {}).textContent || '');
150
151
  const p0 = await pos();
151
- ok('R7 the playhead keeps time on its own clock', await until(async () => (await pos()) !== p0 && /^00:0[1-9] of 31:05/.test(await pos()), 5000), await pos());
152
- await tap(r, '[data-a="play"]');
152
+ ok('R7 the playhead keeps time on its own clock', await until(async () => (await pos()) !== p0 && /^00:0[1-9]$/.test(await pos()), 5000), await pos());
153
+ await tap(r, '.vzp-dt [data-a="play"]');
153
154
  const p1 = await pos();
154
155
  await r.waitForTimeout(600); // longer than the playhead's 250 ms step: a paused playhead does not move
155
- ok('R7 Pause stops the playhead', (await pos()) === p1 && await r.evaluate(() => document.querySelector('#czViewer [data-a="play"]').dataset.on === 'false'), p1 + ' / ' + await pos());
156
- await r.$eval('#czViewer [data-a="seekto"]', (b) => b.click());
157
- ok('R7 a shot plays from its time, with the topic of that time', await until(async () => /^03:1\d of 31:05 · Viewer beside the chat/.test(await pos())), await pos());
158
- await tap(r, '[data-a="play"]');
159
- /* R12 the full Replay view */
160
- await tap(r, '[data-a="more"]'); // Full replay is in the ⋯ menu: the Agreed mockup's replay well has no row for it
161
- await tap(r, '[data-a="m-replay"]');
162
- ok('R12 Full replay opens its plain view, marked Waiting for design, with every line', await until(async () => !!(await r.$('#czViewer [data-cz-placeholder="Full Replay view"]')) && /\d+ lines\. Press a line to play from it\./.test(await text(r)) && /Saved views move in their own work-item\./.test(await text(r))), (await text(r)).slice(0, 300));
163
- await r.$eval('#czViewer [data-f="at"][data-t="760000"]', (b) => b.click());
164
- ok('R12 a line plays from its time, back in the card', await until(async () => /^12:[45]\d of 31:05/.test(await pos()) && !(await r.$('#czViewer [data-a="back"]'))), await pos());
156
+ ok('R7 Pause stops the playhead', (await pos()) === p1 && !(await playing()), p1 + ' / ' + await pos());
157
+ await r.$eval('#czViewer .vzp-dt .vzp-th[data-a="seekto"]', (b) => b.click());
158
+ ok('R7 a capture plays from its time, with the topic of that time', await until(async () => /^03:1\d$/.test(await pos()) && await r.evaluate(() => /Viewer beside the chat/.test((document.querySelector('#czViewer .vzp-top[aria-current="true"]') || {}).textContent || ''))), await pos());
159
+ await tap(r, '.vzp-dt [data-a="play"]');
160
+ /* R12 every line: the Transcript tab seeks the Replay */
161
+ await tap(r, '[data-a="tab"][data-k="tr"]');
162
+ ok('R12 the Transcript lists every line, each with its time to play from', await until(async () => /Saved views move in their own work-item\./.test(await text(r)) && !!(await r.$('#czViewer [data-a="trseek"][data-t="760000"]'))), (await text(r)).slice(0, 300));
163
+ await r.$eval('#czViewer [data-a="trseek"][data-t="760000"]', (b) => b.click());
164
+ ok('R12 a line plays from its time, back on the Replay tab', await until(async () => /^12:[45]\d$/.test(await pos()) && await r.evaluate(() => document.querySelector('#czViewer [data-a="tab"][data-k="replay"]').getAttribute('aria-selected') === 'true')), await pos());
165
165
  await C.ctx.close();
166
166
 
167
167
  /* R11 floors */
168
168
  const D = await open('/premium-viewer.html?open=meeting&note=n2', { noLive: false, w: 390, h: 844, init: () => { window.__premiumHolding = { id: 'n2' }; } });
169
- await until(() => D.page.evaluate(() => !!document.querySelector('#czViewer .vz-bar')), 15000);
169
+ await until(() => D.page.evaluate(() => !!document.querySelector('#czViewer .vzm-rec')), 15000);
170
170
  const fl = await D.page.evaluate(() => ({ over: document.documentElement.scrollWidth - innerWidth, chip: !!document.querySelector('#recChip, #recCtl') }));
171
171
  ok('R11 at 390 px the live card has no sideways scroll and no floating record chip', fl.over <= 0 && !fl.chip, JSON.stringify(fl));
172
172
  await D.ctx.close();
@@ -46,44 +46,43 @@ const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'applicati
46
46
  /* C1 the strip */
47
47
  const A = await open('/premium-viewer.html?open=calendar');
48
48
  const p = A.page;
49
- ok('C1 the calendar opens in the Viewer card', await until(() => p.evaluate(() => document.querySelectorAll('#czViewer .vz-day').length === 5), 15000));
50
- const strip = await p.evaluate(() => [...document.querySelectorAll('#czViewer .vz-day')].map((d) => ({ dow: d.querySelector('span').textContent, on: d.getAttribute('aria-pressed'), h: Math.round(d.getBoundingClientRect().height) })));
51
- ok('C1 the strip has Monday to Friday and today is pressed', strip.map((d) => d.dow).join() === 'MON,TUE,WED,THU,FRI' && strip.filter((d) => d.on === 'true').length === 1, JSON.stringify(strip));
49
+ ok('C1 the calendar opens in the Viewer card', await until(() => p.evaluate(() => !!document.querySelector('#czViewer [data-c="view"][data-k="day"]')), 15000));
50
+ await tap(p, '[data-c="view"][data-k="day"]'); // premium-uncovered-features (meetings): the desk opens on the week; Day is the strip and the day's list
51
+ await until(() => p.evaluate(() => document.querySelectorAll('#czViewer .vzc-dy').length === 5));
52
+ const strip = await p.evaluate(() => [...document.querySelectorAll('#czViewer .vzc-dy')].map((d) => ({ dow: d.querySelector('span').textContent, on: d.getAttribute('aria-pressed'), h: Math.round(d.getBoundingClientRect().height) })));
53
+ ok('C1 the strip has Monday to Friday and today is pressed', strip.map((d) => d.dow).join() === 'Mon,Tue,Wed,Thu,Fri' && strip.filter((d) => d.on === 'true').length === 1, JSON.stringify(strip));
52
54
  ok('C1 each day button is at least 44 px', strip.every((d) => d.h >= 44), JSON.stringify(strip));
53
- ok('C1 the week is read once when the page opens, for today\'s week', weekReads(A.S) === 1 && A.S.gets.some((g) => g.includes('view=week')), JSON.stringify(A.S.gets.filter((g) => g.startsWith('/api/calendar-views'))));
55
+ ok('C1 the week is read once when the page opens, for today\'s week, and Day reads nothing more', weekReads(A.S) === 1 && A.S.gets.some((g) => g.includes('view=week')), JSON.stringify(A.S.gets.filter((g) => g.startsWith('/api/calendar-views'))));
54
56
 
55
57
  /* C2 the day */
56
58
  const today = await text(p);
57
- ok('C2 Today names the day and counts its entries', /Today, \w{3} \d{1,2} \w{3}\s+\d+ entr(y|ies)/.test(today), today.slice(0, 400));
59
+ ok('C2 the day is named "· today" and its entries counted', /\w{3} \d{1,2} \w{3} · today/.test(today) && /\d+ (entr(y|ies)|meetings?)/.test(today), today.slice(0, 400));
58
60
  ok('C2 a row shows the time, the title, what it is about and the people', /\d{2}:\d{2}\s+Rail review\s+Viewer · Sam, Wawan/.test(today), today.slice(0, 600));
59
- await p.evaluate(() => [...document.querySelectorAll('#czViewer .vz-day')].find((d) => d.getAttribute('aria-pressed') === 'false' && d.querySelector('i').hasAttribute('data-on')).click());
60
- ok('C2 pressing a day lists that day only, with its count', await until(async () => { const t = await text(p); return /1:1 with Dita/.test(t) && !/Rail review/.test(t) && /\b1 entry\b/.test(t); }), (await text(p)).slice(0, 400));
61
+ await p.evaluate(() => [...document.querySelectorAll('#czViewer .vzc-dy')].find((d) => d.getAttribute('aria-pressed') === 'false' && /: 1 meeting$/.test(d.getAttribute('aria-label'))).click());
62
+ ok('C2 pressing a day lists that day only, with its count', await until(async () => { const t = await text(p); return /1:1 with Dita/.test(t) && !/Rail review/.test(t) && /\b1 meeting\b/.test(t); }), (await text(p)).slice(0, 400));
61
63
  ok('C2 another day of the same week is not read again', weekReads(A.S) === 1);
62
- await p.evaluate(() => [...document.querySelectorAll('#czViewer .vz-day')].find((d) => /today/.test(d.querySelector('small').textContent)).click());
64
+ await p.evaluate(() => [...document.querySelectorAll('#czViewer .vzc-dy')].find((d) => /today/.test(d.getAttribute('aria-label'))).click());
63
65
  ok('C2 pressing today brings Today back unchanged', await until(async () => (await text(p)) === today));
64
66
 
65
67
  /* C4 a meeting */
66
- await p.evaluate(() => [...document.querySelectorAll('#czViewer .vz-row')].find((r) => /Rail review/.test(r.textContent)).click());
67
- ok('C4 a row opens the meeting card with its title and when', await until(async () => /Rail review/.test(await p.textContent('#czViewer .cz-vw-title')) && /Today \d{2}:\d{2} to \d{2}:\d{2}/.test(await text(p))), (await text(p)).slice(0, 300));
68
+ await p.evaluate(() => [...document.querySelectorAll('#czViewer .vzc-de')].find((r) => /Rail review/.test(r.textContent)).click());
69
+ ok('C4 a row opens the meeting card with its title and when', await until(async () => /Rail review/.test(await p.textContent('#czViewer .cz-vw-title')) && /Today · \d{2}:\d{2}/.test(await text(p))), (await text(p)).slice(0, 300));
68
70
  ok('C4 the card reads Focus for that meeting, and no replay (it has no note)', await until(() => A.S.gets.some((g) => /meeting-focus\?event=ev-rail/.test(g))) && !A.S.gets.some((g) => /meeting-replay/.test(g)));
69
71
  ok('C4 the card has no conversation and no tabs', await p.evaluate(() => !document.querySelector('#dlg, .stream, #vTabs')));
70
72
 
71
73
  /* C6, C7, C8 the parts */
72
- ok('C6 with no note the card says the notes are written after the meeting', /Notes and next steps\s+Written after the meeting/.test(await text(p)));
73
- ok('C7 the material is listed, with who linked it and its topic', /Material 2 linked/.test(await text(p)) && /Rail PRD\s+added by you/.test(await text(p)) && /For The report panel/.test(await text(p)));
74
- ok('C8 with no recording the card offers no Replay', !(await p.$('#czViewer [data-a="replay"]')));
74
+ ok('C6 with no note the card is the prep: Prepared for you, and no tabs', /Prepared for you/.test(await text(p)) && !(await p.$('#czViewer [role="tablist"]')));
75
+ ok('C7 the material is listed, with who linked it and its topic; a deck has Present', /Rail PRD · added by you/.test(await text(p)) && /For The report panel/.test(await text(p)) && !!(await p.$('#czViewer [data-a="present"]')));
76
+ ok('C8 with no recording the card offers no Replay', !(await p.$('#czViewer [data-a="tab"][data-k="replay"]')));
75
77
 
76
78
  /* C5 link it: a calendar meeting is linked for its whole series */
77
- await tap(p, '[data-a="more"]');
78
79
  await tap(p, '[data-a="m-about"]');
79
- const opts = await until(() => p.evaluate(() => { const s = document.querySelector('#czViewer [data-a="aboutsel"]'); return s ? [...s.options].map((o) => o.textContent) : null; }));
80
- ok('C5 the choices are the Portfolio, the boards and Remove the link, marked Waiting for design', opts && opts.join('|') === 'Choose|Portfolio|Board: Growth|Remove the link' && !!(await p.$('#czViewer [data-cz-placeholder="About picker"]')), JSON.stringify(opts));
80
+ const opts = await until(() => p.evaluate(() => { const s = [...document.querySelectorAll('#czViewer [data-a="aboutpick"]')]; return s.length ? s.map((o) => o.textContent.trim()) : null; }));
81
+ ok('C5 What it is about offers the product, the whole portfolio and Leave it out, with no Waiting for design marker', opts && opts.join('|').endsWith('Growth · product|The whole portfolio|Leave it out of an initiative') && !(await p.$('#czViewer [data-cz-placeholder]')), JSON.stringify(opts));
81
82
  ok('C5 it says it applies to every meeting and the calendar is never written', /Applies to every meeting of “Rail review”\. The calendar itself is never written\./.test(await text(p)));
82
- await tap(p, '[data-a="aboutgo"]');
83
- ok('C5 Link it with no choice writes nothing', A.S.posts.length === 0);
83
+ ok('C5 opening the choices writes nothing', A.S.posts.length === 0);
84
84
  const r0 = weekReads(A.S);
85
- await p.selectOption('#czViewer [data-a="aboutsel"]', 'board|w1|b1');
86
- await tap(p, '[data-a="aboutgo"]');
85
+ await tap(p, '[data-a="aboutpick"][data-v="board|w1|b1"]');
87
86
  const link = await until(() => A.S.posts.find((x) => x.path === '/api/calendar-links'));
88
87
  ok('C5 the press posts one link to /api/calendar-links for the meeting', link && JSON.stringify(link.body).includes('Rail review') && JSON.stringify(link.body).includes('b1') && A.S.posts.length === 1, JSON.stringify(link && link.body));
89
88
  ok('C5 after the write the week is read again and the card says Linked', await until(async () => weekReads(A.S) > r0 && /Linked\./.test(await text(p))), String(weekReads(A.S)) + ' ' + r0 + ' ' + (await text(p)).slice(0, 300));
@@ -95,7 +94,7 @@ const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'applicati
95
94
 
96
95
  /* C8 a kept recording offers Replay */
97
96
  const R = await open('/premium-viewer.html?open=meeting&note=n1');
98
- ok('C8 a kept recording offers Replay, and the card reads its replay', await until(() => R.page.evaluate(() => !!document.querySelector('#czViewer [data-a="replay"]')), 15000) && R.S.gets.some((g) => /meeting-replay\?note=n1/.test(g)));
97
+ ok('C8 a kept recording offers Replay, and the card reads its replay', await until(() => R.page.evaluate(() => !!document.querySelector('#czViewer [data-a="tab"][data-k="replay"]')), 15000) && R.S.gets.some((g) => /meeting-replay\?note=n1/.test(g)));
99
98
  await R.ctx.close();
100
99
 
101
100
  /* C3 honest states */
@@ -103,10 +102,10 @@ const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'applicati
103
102
  await E.page.route('**/api/calendar-views*', (r) => { const w = W.week(); w.cells.forEach((c) => { c.events = []; }); return json(r, w); });
104
103
  await E.page.route(/\/api\/notes(\?.*)?$/, (r) => json(r, { ok: true, notes: [], series_open: {} }));
105
104
  await E.page.reload();
106
- ok('C3 an empty day says so', await until(async () => /Today, .*\s+No meetings/.test(await text(E.page)) && !(await E.page.$('#czViewer .vz-row[data-c="open"]'))), (await text(E.page)).slice(0, 400));
105
+ ok('C3 an empty week says so', await until(async () => /No meetings in this week/.test(await text(E.page)) && !(await E.page.$('#czViewer .vzc-ev'))), (await text(E.page)).slice(0, 400));
107
106
  await E.page.route('**/api/calendar-views*', (r) => json(r, { ok: false, error: 'the calendar is not connected' }, 500));
108
107
  await E.page.reload();
109
- ok('C3 a failed read says the calendar was not read, with the reason, and draws no meeting', await until(async () => /The calendar was not read\. the calendar is not connected/.test(await text(E.page))) && !(await E.page.$('#czViewer .vz-row[data-c="open"]')), (await text(E.page)).slice(0, 300));
108
+ ok('C3 a failed read says the calendar was not read, with the reason, and draws no meeting', await until(async () => /The calendar was not read\. the calendar is not connected/.test(await text(E.page))) && !(await E.page.$('#czViewer .vzc-ev')), (await text(E.page)).slice(0, 300));
110
109
  await E.ctx.close();
111
110
 
112
111
  /* C4 Escape closes the card */
@@ -119,7 +118,7 @@ const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'applicati
119
118
  /* C10 floors */
120
119
  const H = await open('/premium-viewer.html?open=meeting&event=ev-rail&date=' + F.dayKey(W.RAIL), { w: 390, h: 844 });
121
120
  await until(() => H.page.evaluate(() => !!document.querySelector('#czViewer .vz-mtg')), 15000);
122
- const fl = await H.page.evaluate(() => ({ over: document.documentElement.scrollWidth - innerWidth, head: [...document.querySelectorAll('#czViewer .vz-r1 > button')].filter((b) => b.getClientRects().length).map((b) => Math.round(b.getBoundingClientRect().height)) }));
121
+ const fl = await H.page.evaluate(() => ({ over: document.documentElement.scrollWidth - innerWidth }));
123
122
  ok('C10 at 390 px the meeting card has no sideways scroll', fl.over <= 0, JSON.stringify(fl));
124
123
  await H.ctx.close();
125
124
  ok('C9 no page error', ALL.every((x) => x.errors.length === 0), JSON.stringify(ALL.map((x) => x.errors).filter((e) => e.length)));
@@ -77,8 +77,12 @@ const prop = (o) => Object.assign({ id: 'prop-a', state: 'proposed', prompt: 'ad
77
77
  await page.route('**/api/docs?*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, docs: [{ path: PATH, links: [] }] }) }));
78
78
  await page.goto(BASE + '/premium.html?ini=self-serve-v2&ws=w1&theme=' + theme);
79
79
  await until(() => page.evaluate(() => !!document.querySelector('.hm-r[data-id="f:planning/prd/self-serve-v2-prd.md"]')), 15000);
80
- if (w < 761) await page.click('#hmNeeds'); // a phone: the list is the top bar's sheet
81
- await page.click('.hm-r[data-id="f:planning/prd/self-serve-v2-prd.md"] .hm-rm'); // the initiative's Files group: the PRD opens as a page
80
+ await until(() => page.evaluate(() => !!document.querySelector('#hmList [data-hi-open="docs"]')), 15000);
81
+ if (!(await page.evaluate(() => !!document.querySelector('#hmList [data-hi-open="docs"]').offsetParent))) await page.click('#hmNeeds'); // a phone may show the list in the top bar's sheet
82
+ // the initiative's Core documents group (in place of the Files group, premium-uncovered-features InDocs) opens every document in the Viewer
83
+ await page.click('#hmList [data-hi-open="docs"]');
84
+ await until(() => page.evaluate(() => !!document.querySelector('#czViewer [data-ov-open="planning/prd/self-serve-v2-prd.md"]')), 15000);
85
+ await page.click('#czViewer [data-ov-open="planning/prd/self-serve-v2-prd.md"]'); // the PRD opens as a page
82
86
  await until(() => page.evaluate(() => document.querySelector('.vwdoc .cf') && document.querySelector('.vwdoc .vwside')));
83
87
  return { ctx, page, S };
84
88
  };
@@ -9,7 +9,7 @@
9
9
  * and search and the document sheet's tabs have no place in the Agreed design and are not drawn.
10
10
  * Serves the real page from the real server. Most checks answer GET /api/initiative-premium with the model lib/initiative-premium.js builds from a
11
11
  * fixture and GET /api/board-premium with lib/board-premium.js's; the last block reads this repository's own initiative through the real route.
12
- * I1 place · I2 reading · I3 header · I4 overview · I6 tasks · I7 documents · I10 presses · I12 floors and fidelity */
12
+ * I1 place · I2 reading · I3 header · I4 overview (Tasks, Documents, Stage: premium-uncovered-features) · I6 tasks · I7 documents · I10 presses · I12 floors and fidelity */
13
13
  const path = require('path');
14
14
  const { spawn } = require('child_process');
15
15
  const { findBrowser } = require('./lib/find-browser');
@@ -73,9 +73,14 @@ const WRITES = /^\/api\/(?:boards\/(?:move|tasks\/(?:add|state))|lifecycle|core-
73
73
  // ready: the card is drawn from the board's row (kind · anchor) and, when the initiative reads, from its record (the ladder)
74
74
  async function ready(page, full = true) { return until(() => page.evaluate((f) => !!document.querySelector('.hm-card [data-hm-ov]') && /·/.test((document.querySelector('.hm-card .hm-sw .k') || {}).textContent || '') && (!f || !!((document.querySelector('.hm-card .hm-lad b') || {}).textContent || '').trim()), full), 30000); }
75
75
  const txt = (p, s) => p.evaluate((q) => ((document.querySelector(q) || {}).textContent || '').replace(/\s+/g, ' ').trim(), s);
76
- const overview = async (p) => {
76
+ // the Overview opens on Tasks, with Documents and Stage beside it (premium-uncovered-features, canvas InTasks, InDocs, InStage); view names the one to show
77
+ const show = async (p, view) => { await p.click(`${V} [data-hi-view="${view}"]`); return until(() => p.evaluate((a) => !!document.querySelector(a[0] + ` [data-hi-v="${a[1]}"]`), [V, view])); };
78
+ const overview = async (p, view = 'stage') => {
77
79
  if (!(await p.evaluate(() => { const b = document.querySelector('.hm-card [data-hm-ov]'); return !!b && !!b.offsetParent; }))) await p.click('#hmNeeds'); // a phone shows the list (and its card) in the sheet
78
- await p.click('.hm-card [data-hm-ov]'); return until(() => p.evaluate((v) => !!document.querySelector(v + ' [data-ov-move]') || /could not be read|Reading the initiative/.test((document.querySelector(v) || {}).textContent || ''), V), 15000); };
80
+ await p.click('.hm-card [data-hm-ov]');
81
+ const s = await until(() => p.evaluate((v) => { const o = document.querySelector(v); if (!o) return null; if (o.querySelector('[data-hi-view]')) return 'ok'; return /could not be read/.test(o.textContent) ? 'err' : null; }, V), 30000);
82
+ if (s === 'ok' && view) await show(p, view);
83
+ return !!s; };
79
84
  const writes = (X) => X.posts.filter((x) => WRITES.test(x.path));
80
85
 
81
86
  const A = await open(), p = A.page;
@@ -118,23 +123,30 @@ const WRITES = /^\/api\/(?:boards\/(?:move|tasks\/(?:add|state))|lifecycle|core-
118
123
  ok('I3 it unfolds again', await until(() => p.evaluate(() => document.querySelector('.hm-card [data-hm-cfold]').getAttribute('aria-expanded') === 'true' && document.querySelectorAll('.hm-card .hm-it').length > 0)));
119
124
  ok('I1 the card wrote nothing on its own', writes(A).length === 0, JSON.stringify(writes(A)));
120
125
 
121
- /* I7 documents: the list's Files group opens a document's page in the Viewer */
122
- ok('I7 the list holds the initiative\'s files, the PRD among them', await until(() => p.evaluate(() => !!document.querySelector('.hm-r[data-id="f:planning/prd/self-serve-v2-prd.md"]'))));
123
- await p.click('.hm-r[data-id="f:planning/prd/self-serve-v2-prd.md"] .hm-rm');
126
+ /* I7 documents: the list's Core documents group (in place of the Files group) shows the ones that need a look and opens them all in the Viewer (InDocs) */
127
+ ok('I7 the list holds Core documents with its count and an All documents line; the Files group is gone', await until(() => p.evaluate(() => { const g = document.querySelector('#hmList section[data-hi="docs"]'); const f = document.querySelector('#hmList section.hm-g[aria-label="Files"]'); return !!g && /Core documents/.test(g.textContent) && !!g.querySelector('[data-hi-open="docs"]') && (!f || f.hidden); })));
128
+ await p.click('#hmList [data-hi-open="docs"]');
129
+ await until(() => p.evaluate((v) => !!document.querySelector(v + ' [data-ov-open="planning/prd/self-serve-v2-prd.md"]'), V), 15000);
130
+ await p.click(`${V} [data-ov-open="planning/prd/self-serve-v2-prd.md"]`);
124
131
  ok('I7 a file opens as its page in the Viewer, not a dialog', await until(() => p.evaluate((v) => !!document.querySelector(v + ' .obody.vw[data-vw="doc:planning/prd/self-serve-v2-prd.md"]') && !(document.querySelector('#dlg') && !!document.querySelector('#dlg.on')), V), 15000));
125
132
 
126
133
  /* I4 the Overview */
127
- ok('I4 the card\'s Overview press opens the Overview in the Viewer, marked Waiting for design', await overview(p) && await p.evaluate((v) => /Overview/.test(document.querySelector('#czViewer .cz-vw-kind').textContent) && !!document.querySelector(v + ' .hx-wait'), V));
128
- const ov = await p.evaluate((v) => { const o = document.querySelector(v); return { moves: [...o.querySelectorAll('[data-ov-move]')].map((b) => b.dataset.ovMove), cur: (o.querySelector('[data-ov-move][aria-pressed="true"]') || {}).textContent, life: [...o.querySelectorAll('[data-ov-life]')].map((b) => b.dataset.ovLife), tasks: [...o.querySelectorAll('[data-ov-tkrow] b')].map((b) => b.textContent), states: [...o.querySelectorAll('[data-ov-task]')].map((s) => s.dataset.ovTask + '=' + s.value), docs: [...o.querySelectorAll('[data-ov-doc]')].map((d) => d.dataset.ovDoc), draft: [...o.querySelectorAll('[data-ov-draft]')].map((b) => b.dataset.ovDraft), drafting: [...o.querySelectorAll('[data-ov-doc]')].filter((d) => /Drafting/.test(d.textContent)).map((d) => d.dataset.ovDoc), dread: [...o.querySelectorAll('[data-ov-dread]')].map((b) => b.dataset.ovDread), sum: (o.querySelector('[data-ov-dsum]') || {}).textContent || '' }; }, V);
134
+ ok('I4 the card\'s Overview press opens the initiative in the Viewer on its Tasks, with Documents and Stage beside it, and no Waiting for design marker', await overview(p, null) && await p.evaluate((v) => /Tasks/.test(document.querySelector('#czViewer .cz-vw-kind').textContent) && [...document.querySelectorAll(v + ' [data-hi-view]')].map((b) => b.textContent).join() === 'Tasks,Documents,Stage' && !document.querySelector(v + ' .hx-wait'), V));
135
+ const tk = await p.evaluate((v) => { const o = document.querySelector(v); return { tasks: [...o.querySelectorAll('[data-ov-tkrow]')].map((r) => r.dataset.ovTkrow).sort(), checks: [...o.querySelectorAll('button[data-hi-chk]')].map((b) => b.dataset.hiChk).sort() }; }, V);
136
+ await show(p, 'stage');
137
+ const st = await p.evaluate((v) => { const o = document.querySelector(v); return { moves: [...o.querySelectorAll('[data-ov-move]')].map((b) => b.dataset.ovMove), cur: (o.querySelector('[data-ov-move][aria-pressed="true"]') || {}).textContent, life: [...o.querySelectorAll('[data-ov-life]')].map((b) => b.dataset.ovLife) }; }, V);
138
+ await show(p, 'docs');
139
+ const ov = await p.evaluate((v) => { const o = document.querySelector(v); return { docs: [...o.querySelectorAll('[data-ov-doc]')].map((d) => d.dataset.ovDoc).sort(), draft: [...o.querySelectorAll('[data-ov-draft]')].map((b) => b.dataset.ovDraft).sort(), drafting: [...o.querySelectorAll('[data-ov-doc]')].filter((d) => /Drafting/.test(d.textContent)).map((d) => d.dataset.ovDoc), dread: [...o.querySelectorAll('[data-ov-dread]')].map((b) => b.dataset.ovDread), sum: (o.querySelector('[data-ov-dsum]') || {}).textContent || '' }; }, V);
129
140
  const M = mk();
130
- ok('I4 the stage row lists the board\'s stages with the current one pressed, and the lifecycle presses', JSON.stringify(ov.moves) === JSON.stringify(M.acts.stages) && ov.cur === 'Build' && ov.life.join() === 'on-hold,cancelled', JSON.stringify(ov));
131
- ok('I6 the tasks are the record\'s, and only a PMOS task has a status control with its own state', JSON.stringify(ov.tasks) === JSON.stringify(M.tasks.rows.slice(0, 40).map((t) => t.title)) && JSON.stringify(ov.states) === JSON.stringify(M.tasks.rows.filter((t) => t.pmos && t.uid).map((t) => t.uid + '=' + t.state)), JSON.stringify(ov));
132
- ok('I7 the core documents are the non-technical ones, with the engine\'s summary', JSON.stringify(ov.docs) === JSON.stringify(M.docs.rows.filter((d) => !d.tech).map((d) => d.key)) && ov.sum === M.docs.cap, JSON.stringify(ov));
141
+ ok('I4 the Stage view lists the board\'s stages with the current one pressed, and the lifecycle presses', JSON.stringify(st.moves) === JSON.stringify(M.acts.stages) && st.cur === 'Build' && st.life.join() === 'on-hold,cancelled', JSON.stringify(st));
142
+ ok('I6 the tasks are the record\'s, and only a PMOS task has a check box it can change', JSON.stringify(tk.tasks) === JSON.stringify(M.tasks.rows.map((t) => t.key).sort()) && JSON.stringify(tk.checks) === JSON.stringify(M.tasks.rows.filter((t) => t.pmos && t.uid).map((t) => t.key).sort()), JSON.stringify(tk));
143
+ ok('I7 the core documents are the non-technical ones, with the engine\'s summary', JSON.stringify(ov.docs) === JSON.stringify(M.docs.rows.filter((d) => !d.tech).map((d) => d.key).sort()) && ov.sum === M.docs.cap, JSON.stringify(ov));
133
144
  ok('I7 a document not started offers Draft it; a running one says Drafting and has no press; a draft offers Read', ov.draft.join() === 'problem,research' && ov.drafting.join() === 'launch' && ov.dread.length === M.docs.rows.filter((d) => !d.tech && d.st === 'draft' && d.path && d.slot).length, JSON.stringify(ov));
134
145
 
135
146
  /* I10 presses */
136
147
  const mint = await T.nonce(BASE);
137
148
  const settle = async (fn) => { const c = A.calls(); await fn(); await until(() => A.calls() > c, 10000); await sleep(500); }; // a press that lands reads the initiative again and draws the Overview again
149
+ await show(p, 'stage');
138
150
  await settle(() => p.click(`${V} [data-ov-move="Deliver"]`));
139
151
  const mv = await until(() => A.posts.find((x) => x.path === '/api/boards/move'));
140
152
  ok('I10 a stage press posts the board, the initiative and the stage to the move route', mv && mv.body.ws === 'w1' && mv.body.board === 'w1' && mv.body.id === 'self-serve-v2' && mv.body.to === 'Deliver', JSON.stringify(mv && mv.body));
@@ -146,16 +158,22 @@ const WRITES = /^\/api\/(?:boards\/(?:move|tasks\/(?:add|state))|lifecycle|core-
146
158
  await p.fill(`${V} #ovWhy`, 'Waiting on legal'); await settle(() => p.click(`${V} [data-ov-life-go]`));
147
159
  const lf = await until(() => A.posts.find((x) => x.path === '/api/lifecycle'));
148
160
  ok('I10 Record posts the state and the reason to the lifecycle route', lf && lf.body.initiative_id === 'self-serve-v2' && lf.body.state === 'on-hold' && lf.body.reason === 'Waiting on legal' && lf.body.ws === 'w1', JSON.stringify(lf && lf.body));
161
+ await show(p, 'tasks');
149
162
  await until(() => p.evaluate((v) => !!document.querySelector(v + ' #ovTask'), V));
150
163
  await p.click(`${V} [data-ov-add]`); await sleep(200);
151
164
  ok('I6 Add with no title posts nothing', !A.posts.some((x) => x.path === '/api/boards/tasks/add'));
152
165
  await p.fill(`${V} #ovTask`, 'Release plan'); await settle(() => p.click(`${V} [data-ov-add]`));
153
166
  const ad = await until(() => A.posts.find((x) => x.path === '/api/boards/tasks/add'));
154
167
  ok('I10 Add posts the workspace, the board, this initiative and the title to the board\'s own route', ad && ad.body.ws === 'w1' && ad.body.board === 'w1' && ad.body.initiative === 'self-serve-v2' && ad.body.title === 'Release plan', JSON.stringify(ad && ad.body));
155
- await until(() => p.evaluate((v) => !!document.querySelector(v + ' [data-ov-task]'), V));
156
- await settle(() => p.selectOption(`${V} [data-ov-task]`, 'In progress'));
168
+ // a PMOS task's status is in its row's menu (InTasks)
169
+ const pk = M.tasks.rows.find((t) => t.pmos && t.uid).key;
170
+ await until(() => p.evaluate((a) => !!document.querySelector(a[0] + ` [data-hi-tmore="${a[1]}"]`), [V, pk]));
171
+ await p.click(`${V} [data-hi-tmore="${pk}"]`);
172
+ await until(() => p.evaluate(() => !!document.querySelector('.hi-pop[role="menu"]')));
173
+ await settle(() => p.click('.hi-pop[role="menu"] [role="menuitemradio"]:has(span:text-is("In progress"))'));
157
174
  const ts = await until(() => A.posts.find((x) => x.path === '/api/boards/tasks/state'));
158
175
  ok('I10 a status change posts the board, the task and the state, and nothing else', ts && Object.keys(ts.body).sort().join() === 'board,state,task,ws' && ts.body.state === 'In progress', JSON.stringify(ts && ts.body));
176
+ await show(p, 'docs');
159
177
  await until(() => p.evaluate((v) => !!document.querySelector(v + ' [data-ov-draft="problem"]'), V));
160
178
  await settle(() => p.click(`${V} [data-ov-draft="problem"]`));
161
179
  const dr = await until(() => A.posts.find((x) => x.path === '/api/core-docs/draft'));
@@ -188,9 +206,13 @@ const WRITES = /^\/api\/(?:boards\/(?:move|tasks\/(?:add|state))|lifecycle|core-
188
206
  /* I12 floors at 390 */
189
207
  {
190
208
  const N = await open({ w: 390, h: 844 });
191
- await overview(N.page);
192
- const fl = await N.page.evaluate((v) => { const o = document.querySelector(v); const small = [...o.querySelectorAll('button, select, input')].filter((b) => b.offsetParent && b.getBoundingClientRect().height < 44).map((b) => b.textContent.trim().slice(0, 24) || b.id || b.tagName); return { over: document.documentElement.scrollWidth - innerWidth, small, vw: Math.round(o.getBoundingClientRect().width) }; }, V);
193
- ok('I12 at 390 px the Overview has no sideways scroll and every target is 44 px', fl.over <= 0 && fl.small.length === 0, JSON.stringify(fl));
209
+ await overview(N.page, null);
210
+ const fls = [];
211
+ for (const view of ['tasks', 'docs', 'stage']) {
212
+ await show(N.page, view);
213
+ fls.push(await N.page.evaluate((a) => { const o = document.querySelector(a[0]); const small = [...o.querySelectorAll('button, select, input')].filter((b) => b.offsetParent && b.getBoundingClientRect().height < 44).map((b) => b.textContent.trim().slice(0, 24) || b.id || b.getAttribute('aria-label') || b.tagName); return { view: a[1], over: document.documentElement.scrollWidth - innerWidth, small }; }, [V, view]));
214
+ }
215
+ ok('I12 at 390 px the Overview\'s Tasks, Documents and Stage have no sideways scroll and every target is 44 px', fls.every((fl) => fl.over <= 0 && fl.small.length === 0), JSON.stringify(fls));
194
216
  ok('I12 no page error at 390 px', N.errors.length === 0, N.errors.join(' | '));
195
217
  await N.ctx.close();
196
218
  }