create-pmos 0.397.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.
- package/package.json +25 -25
- package/payload/KIT-VERSION +2 -2
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/state/discoveries.md +1 -1
- package/payload/state/log.md +1 -1
- package/workspace/briefing-premium-adddoc-test.js +105 -52
- package/workspace/briefing-premium-board-test.js +284 -128
- package/workspace/briefing-premium-calendar-2-test.js +135 -198
- package/workspace/briefing-premium-calendar-3-test.js +143 -418
- package/workspace/briefing-premium-calendar-test.js +85 -196
- package/workspace/briefing-premium-doc-edit-test.js +99 -83
- package/workspace/briefing-premium-initiative-test.js +175 -290
- package/workspace/briefing-premium-insights-test.js +414 -219
- package/workspace/briefing-premium-metrics-test.js +55 -97
- package/workspace/briefing-premium-products-test.js +44 -28
- package/workspace/briefing-premium-sources-test.js +70 -49
- package/workspace/briefing-premium-test.js +155 -648
- package/workspace/briefing-premium-work-test.js +88 -283
- package/workspace/changelog.json +24 -0
- package/workspace/ev-everywhere-test.js +210 -0
- package/workspace/fixtures/board-premium-trail.js +32 -0
- package/workspace/fixtures/premium-viewer-fixtures.js +187 -0
- package/workspace/guide/briefing-premium.md +3 -1
- package/workspace/guide/home.md +68 -0
- package/workspace/guide/index.md +1 -0
- package/workspace/lib/agent-roles.js +71 -0
- package/workspace/lib/board-grill.js +63 -0
- package/workspace/lib/board-premium.js +121 -24
- package/workspace/lib/board-trail.js +223 -0
- package/workspace/lib/home-work-item.js +58 -0
- package/workspace/lib/initiative-layout.js +77 -0
- package/workspace/lib/insights-goals.js +196 -0
- package/workspace/lib/insights-premium.js +64 -15
- package/workspace/lib/insights-records.js +115 -0
- package/workspace/lib/jira-tickets.js +1 -1
- package/workspace/lib/meeting-points.js +52 -0
- package/workspace/lib/news-for-you.js +88 -0
- package/workspace/lib/notes-series.js +29 -6
- package/workspace/lib/report-confirm.js +48 -0
- package/workspace/lib/route-modules.js +12 -0
- package/workspace/lib/routes-board-docs.js +46 -0
- package/workspace/lib/routes-board-grill.js +90 -0
- package/workspace/lib/routes-board-trail.js +33 -0
- package/workspace/lib/routes-home-desk.js +176 -0
- package/workspace/lib/routes-home-review.js +108 -0
- package/workspace/lib/routes-initiative-layout.js +57 -0
- package/workspace/lib/routes-insights-premium.js +16 -4
- package/workspace/lib/routes-insights-records.js +133 -0
- package/workspace/lib/routes-meeting-points.js +37 -0
- package/workspace/lib/routes-news.js +57 -0
- package/workspace/lib/routes-notes.js +3 -1
- package/workspace/lib/routes-report-confirm.js +31 -0
- package/workspace/lib/routes-search.js +38 -0
- package/workspace/lib/routes-viewer.js +108 -0
- package/workspace/lib/search-index.js +176 -0
- package/workspace/lib/transcript-steps.js +123 -0
- package/workspace/lib/viewer-meeting.js +205 -0
- package/workspace/lib/viewer-report.js +89 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-board-actions-test.js +128 -82
- package/workspace/premium-briefing-depth-test.js +104 -90
- package/workspace/premium-chat-attach-test.js +54 -63
- package/workspace/premium-chat-chart-tab-test.js +37 -37
- package/workspace/premium-chat-context-test.js +19 -18
- package/workspace/premium-chat-goal-view-test.js +23 -23
- package/workspace/premium-chat-notes-test.js +26 -31
- package/workspace/premium-chat-report-tab-test.js +46 -28
- package/workspace/premium-chat-term-test.js +16 -16
- package/workspace/premium-chat-viewer-test.js +60 -59
- package/workspace/premium-core-doc-issue-test.js +52 -43
- package/workspace/premium-html-viewer-test.js +14 -17
- package/workspace/premium-phone-card-test.js +10 -3
- package/workspace/premium-phone-room-test.js +41 -35
- package/workspace/premium-report-read-test.js +152 -197
- package/workspace/premium-viewer-download-test.js +19 -22
- package/workspace/premium-viewer-flicker-test.js +11 -16
- package/workspace/premium-viewer-share-test.js +6 -9
- package/workspace/premium-viewer-test.js +41 -60
- package/workspace/premium-vw-backlog-test.js +53 -33
- package/workspace/premium-vw-cal-test.js +97 -128
- package/workspace/premium-vw-copy-test.js +17 -33
- package/workspace/premium-vw-doc-test.js +17 -10
- package/workspace/premium-vw-item-test.js +50 -49
- package/workspace/premium-vw-jira-test.js +53 -27
- package/workspace/premium-vw-meet-test.js +115 -187
- package/workspace/premium-vw-notes-test.js +88 -109
- package/workspace/premium-vw-rec-test.js +71 -194
- package/workspace/premium-vw-slides-test.js +46 -50
- package/workspace/premium-welcome-test.js +3 -2
- package/workspace/premium-work-depth-test.js +61 -53
- package/workspace/public/pm/bd-acts.js +383 -0
- package/workspace/public/pm/bd-asks.js +261 -0
- package/workspace/public/pm/bd-pop.js +59 -0
- package/workspace/public/pm/bd-span.js +222 -82
- package/workspace/public/pm/bd-stages.js +25 -11
- package/workspace/public/pm/bd-views.js +169 -0
- package/workspace/public/pm/c3-doc-sheet.js +1 -1
- package/workspace/public/pm/c3-md.js +3 -395
- package/workspace/public/pm/c3-phone-detail.js +1 -1
- package/workspace/public/pm/c3-phone-model.js +3 -68
- package/workspace/public/pm/chat-term.js +3 -3
- package/workspace/public/pm/cozy-board.css +798 -230
- package/workspace/public/pm/cozy-ev.css +228 -0
- package/workspace/public/pm/cozy-evmodel.js +106 -0
- package/workspace/public/pm/cozy-evui.js +47 -0
- package/workspace/public/pm/cozy-home.css +570 -142
- package/workspace/public/pm/cozy-home.js +5 -3
- package/workspace/public/pm/cozy-insights.css +437 -170
- package/workspace/public/pm/cozy-md.js +396 -0
- package/workspace/public/pm/cozy-nav.js +104 -29
- package/workspace/public/pm/cozy-news.js +140 -0
- package/workspace/public/pm/cozy-placeholder.js +26 -0
- package/workspace/public/pm/cozy-search.js +203 -0
- package/workspace/public/pm/cozy-settings.js +198 -0
- package/workspace/public/pm/cozy-sources.js +89 -0
- package/workspace/public/pm/cozy-today.css +217 -0
- package/workspace/public/pm/cozy-viewer.css +3 -3
- package/workspace/public/pm/cozy-viewer.js +145 -0
- package/workspace/public/pm/cozy-vw-mtg.css +350 -0
- package/workspace/public/pm/cozy-vw-rp.css +152 -0
- package/workspace/public/pm/cozy-vw.css +485 -0
- package/workspace/public/pm/cozy.css +83 -1
- package/workspace/public/pm/home-adddoc.js +48 -0
- package/workspace/public/pm/home-app.js +1179 -0
- package/workspace/public/pm/home-around.js +413 -0
- package/workspace/public/pm/home-chat.js +512 -0
- package/workspace/public/pm/home-data.js +312 -0
- package/workspace/public/pm/home-dictate.js +54 -0
- package/workspace/public/pm/home-draft.js +68 -0
- package/workspace/public/pm/home-ini-model.js +190 -0
- package/workspace/public/pm/home-ini.css +171 -0
- package/workspace/public/pm/home-ini.js +456 -0
- package/workspace/public/pm/home-list.js +276 -0
- package/workspace/public/pm/home-more.js +132 -0
- package/workspace/public/pm/home-phone-card.js +109 -0
- package/workspace/public/pm/home-review.js +104 -0
- package/workspace/public/pm/home-task.js +67 -0
- package/workspace/public/pm/home-today.js +144 -0
- package/workspace/public/pm/home-work.js +547 -0
- package/workspace/public/pm/phone-moment.js +69 -0
- package/workspace/public/pm/pm-work-view.js +1 -1
- package/workspace/public/pm/premium-attach.js +4 -0
- package/workspace/public/pm/premium-board.js +548 -395
- package/workspace/public/pm/premium-chart-tab.js +109 -62
- package/workspace/public/pm/premium-deck.js +3 -3
- package/workspace/public/pm/premium-first.js +23 -21
- package/workspace/public/pm/premium-insights.js +1102 -581
- package/workspace/public/pm/premium-meeting.js +61 -549
- package/workspace/public/pm/premium-mtg-present.js +138 -0
- package/workspace/public/pm/premium-mtg-replay.js +142 -0
- package/workspace/public/pm/premium-notes.js +1 -1
- package/workspace/public/pm/premium-report-frame.css +20 -0
- package/workspace/public/pm/premium-report-read.js +669 -476
- package/workspace/public/pm/premium-report-tab.js +116 -67
- package/workspace/public/pm/premium-shell.js +76 -123
- package/workspace/public/pm/premium-viewer.js +22 -1
- package/workspace/public/pm/premium-vw-cal.js +277 -48
- package/workspace/public/pm/premium-vw-doc.css +6 -0
- package/workspace/public/pm/premium-vw-doc.js +40 -2
- package/workspace/public/pm/premium-vw-file.js +2 -2
- package/workspace/public/pm/premium-vw-meet.js +6 -83
- package/workspace/public/pm/premium-vw-mtg.js +958 -0
- package/workspace/public/pm/premium-vw-notes.js +116 -68
- package/workspace/public/pm/premium-vw-open.js +35 -0
- package/workspace/public/pm/premium-vw-page.js +16 -0
- package/workspace/public/pm/premium-vw-rec.js +11 -218
- package/workspace/public/pm/premium-vw-slides.css +5 -0
- package/workspace/public/pm/premium-vw-slides.js +44 -8
- package/workspace/public/pm/rp-parts.js +269 -0
- package/workspace/public/pm/term-view.js +22 -0
- package/workspace/public/premium-board.html +29 -70
- package/workspace/public/premium-initiative.html +8 -48
- package/workspace/public/premium-insights.html +26 -64
- package/workspace/public/premium-viewer.html +20 -0
- package/workspace/public/premium.html +18 -107
- package/workspace/r/m1.png +0 -0
- package/workspace/r/m2.png +0 -0
- package/workspace/r/m3.png +0 -0
- package/workspace/r/nl.png +0 -0
- package/workspace/server.js +18 -3
- package/workspace/test-files.json +1 -0
- package/workspace/test-lists/home-libs.json +9 -0
- package/workspace/test-lists/initiative-layout.json +9 -0
- package/workspace/test-lists/premium-report-read.json +1 -1
- package/workspace/test-lists/premium-uncovered-meetings.json +9 -0
- package/workspace/test-lists/premium-uncovered-reports.json +9 -0
- package/workspace/test-lists/premium-vw-agreed.json +9 -0
- package/workspace/test-lists/premium-vw-notes.json +1 -1
- package/workspace/test-lists/uf-everywhere.json +15 -0
- package/workspace/test-lists/uf-home.json +9 -0
- package/workspace/test-lists/uncovered-board.json +9 -0
- package/workspace/public/pm/premium-work.js +0 -729
- package/workspace/public/pm/premium.js +0 -1146
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
|
-
/* premium-briefing-depth-test.js —
|
|
4
|
-
*
|
|
3
|
+
/* premium-briefing-depth-test.js — Around you (initiative premium-briefing-depth; planning/prd/premium-briefing-depth-prd.md R1 to R9).
|
|
4
|
+
* Re-pointed by premium-agreed-design: the Briefing card and its dialogs are gone. Re-pointed again by premium-uncovered-features (canvas
|
|
5
|
+
* HmAround): Around you is gone too. New for you (cozy-news.js, from the place menu) holds the mentions, the digests and the prep line, and
|
|
6
|
+
* its "Where the rest went" rows open the old views (home-around.js), each with Back to New for you. Data freshness is Sources (cozy-sources.js).
|
|
7
|
+
* The row summaries of the old card are gone with it; each view's own line (.ar-say) carries the count.
|
|
8
|
+
* A real server on a scratch repository (c3-scan-fixture.js: PMOS_DRIVER=off, so no agent
|
|
5
9
|
* ever runs), with a driver ledger, a scan ledger and a brief of today that this suite seeds with the writers the product uses. The real page
|
|
6
10
|
* presses the real routes. Only two presses are answered in the browser, because they start an agent: scan/now and sources/refresh. The
|
|
7
11
|
* Calendar's rows are answered in the browser too, because they need plan dates and a clock.
|
|
@@ -90,28 +94,35 @@ const GANTT = [
|
|
|
90
94
|
await p.route('**/api/scan/now', (r) => json(r, { ok: true, scan: 'scan-00000000ff' }));
|
|
91
95
|
await p.route('**/api/sources/refresh', (r) => json(r, { ok: true, started: 'session' }));
|
|
92
96
|
await p.route('**/api/sources/refresh-all', (r) => json(r, { ok: true, joined: false, started: ['calendar'], already: [], failed: [], all: { started_at: new Date().toISOString(), reads: ['calendar'], derived: ['brief'], phase: 'read', done: false, steps: [{ id: 'calendar', label: 'Calendar', step: 'read', state: 'running' }, { id: 'brief', label: 'Morning briefing', step: 'derived', state: 'waiting' }] } }));
|
|
97
|
+
/* New for you: the place menu, then New for you; it reads what is new and names where the rest went */
|
|
98
|
+
const REST = ['pulse', 'rep', 'prop', 'scan'];
|
|
99
|
+
const openCard = async () => {
|
|
100
|
+
await until(() => p.$('#czFab')); await p.click('#czFab'); await p.click('#czMenu [data-cz-news]');
|
|
101
|
+
await until(() => p.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) .ev-news [data-ev-rest]') && !document.querySelector('#czViewer .ev-news .ev-skelrow')), 30000);
|
|
102
|
+
};
|
|
93
103
|
await p.goto(`${F.BASE}/premium.html?ws=${encodeURIComponent(ws)}`);
|
|
94
|
-
await until(() => p.evaluate(() =>
|
|
95
|
-
|
|
96
|
-
await
|
|
97
|
-
const
|
|
98
|
-
const
|
|
99
|
-
|
|
104
|
+
await until(() => p.evaluate(() => document.querySelectorAll('#hmList .hm-g').length > 0), 30000);
|
|
105
|
+
posts.length = 0; // Home's own writes on load (its chat marks a conversation seen) are not Around you's; R8 counts from the card's opening
|
|
106
|
+
await openCard();
|
|
107
|
+
const say = () => p.evaluate(() => (document.querySelector('#czViewer .ar-say') || {}).textContent || '');
|
|
108
|
+
const body = () => p.evaluate(() => (document.querySelector('#czViewer .cz-vw-body .bd-a') || {}).textContent || '');
|
|
109
|
+
// a view opens from its "Where the rest went" row when New for you names it; mentions are New for you's own rows, so their full view opens directly
|
|
110
|
+
const open = async (k) => {
|
|
111
|
+
const sel = `#czViewer .ev-news [data-ev-rest="${k}"]`; // p.click finds the row again if New for you redraws it between the look and the press
|
|
112
|
+
if (REST.includes(k) && await p.$(sel)) await p.click(sel); else await p.evaluate((x) => import('/pm/home-around.js').then((M) => M.openAround(x)), k);
|
|
113
|
+
await until(() => p.evaluate((x) => !!document.querySelector(`#czViewer .bd-a[data-bd-view="${x}"] *`), k));
|
|
114
|
+
};
|
|
115
|
+
const close = async () => { await p.click('#czViewer [data-bda="back"]'); await until(() => p.evaluate(() => !!document.querySelector('#czViewer .ev-news [data-ev-rest]'))); };
|
|
100
116
|
const click = async (sel) => { await until(() => p.$(sel)); await p.click(sel); };
|
|
101
117
|
const shotDir = process.env.BRIEFING_DEPTH_SHOTS;
|
|
102
118
|
const shot = async (n) => { if (shotDir) { await sleep(700); fs.mkdirSync(shotDir, { recursive: true }); await p.screenshot({ path: path.join(shotDir, n + '.png') }); } };
|
|
103
119
|
|
|
104
|
-
/* R: the card */
|
|
105
|
-
const R0 = await
|
|
106
|
-
ok('R1 the
|
|
107
|
-
ok('
|
|
108
|
-
ok('
|
|
109
|
-
ok('
|
|
110
|
-
ok('R5 the scan row counts the waiting proposals', /^Horizon scan: \d+ proposals? waits? for you|^Horizon scan: \d+ proposals wait for you/.test(R0.scan.t) && /^\d+$/.test(R0.scan.m), JSON.stringify(R0.scan));
|
|
111
|
-
ok('R6 the freshness row says it is not live', /not live/.test(R0.src.s) && !/up to date/i.test(R0.src.t + R0.src.s), JSON.stringify(R0.src));
|
|
112
|
-
const cap = await p.evaluate(() => document.querySelector('#aroundCap').textContent);
|
|
113
|
-
ok('R7 the caption counts the rows that wait', /^\d+ to look at$/.test(cap), cap);
|
|
114
|
-
ok('R8 nothing was written on load', posts.length === 0, JSON.stringify(posts));
|
|
120
|
+
/* R: New for you, in place of the card */
|
|
121
|
+
const R0 = await p.evaluate(() => ({ rest: [...document.querySelectorAll('#czViewer .ev-news [data-ev-rest]')].map((b) => b.dataset.evRest), list: !!document.querySelector('#aroundBody, #aroundCap'), text: document.querySelector('#czViewer').textContent }));
|
|
122
|
+
ok('R1 New for you names where the rest of Around you went, one row each, and draws no Around you list', R0.rest.join() === REST.join() && !R0.list, JSON.stringify(R0.rest));
|
|
123
|
+
ok('R3 the mentions that wait are New for you\'s own rows', /Dana/.test(R0.text) && /Mentions/.test(R0.text), R0.text.slice(0, 300));
|
|
124
|
+
ok('R8 opening New for you wrote nothing', posts.length === 0, JSON.stringify(posts));
|
|
125
|
+
ok('R9 New for you is drawn to its design: no Waiting for design marker', !/Waiting for design/.test(R0.text));
|
|
115
126
|
await shot('card-1280-light');
|
|
116
127
|
|
|
117
128
|
/* A: agent proposals */
|
|
@@ -119,27 +130,27 @@ const GANTT = [
|
|
|
119
130
|
const ptxt = await body();
|
|
120
131
|
ok('A1 the dialog shows what each proposal is, its target, its draft and its why', /Problem statement/.test(ptxt) && /Move to Plan/.test(ptxt) && /Next step/.test(ptxt) && /Initiative · Partner API onboarding/.test(ptxt) && /Work · Send the partner onboarding list to Lina/.test(ptxt) && /New partners wait 9 days/.test(ptxt) && /Why: first draft from the Jira threads/.test(ptxt), ptxt);
|
|
121
132
|
await shot('props-1280-light');
|
|
122
|
-
const pq = await p.evaluate(() => ({ title: document.querySelector('#
|
|
133
|
+
const pq = await p.evaluate(() => ({ title: document.querySelector('#czVwTitle').textContent, cards: document.querySelectorAll('#czViewer .cz-vw-body .pcard').length, prim: [...document.querySelectorAll('#czViewer .cz-vw-body .pc-bar .pc-p')].map((b) => b.textContent), quiet: [...document.querySelectorAll('#czViewer .cz-vw-body .pc-bar .pc-q')].map((b) => b.textContent), on: (document.querySelector('#czViewer .cz-vw-body .pcard.on') || {}).dataset?.id, notes: document.querySelector('#pcNotes').hidden, keepIn: !!document.querySelector('#czViewer .cz-vw-body .pcard [data-bda="pkeep"]') }));
|
|
123
134
|
ok('A1b one card per proposal, the title counts them, and the bottom bar holds Keep as the only primary with Send back and Drop quiet', pq.title === '3 wait for you' && pq.cards === 3 && pq.prim.join() === 'Keep' && pq.quiet.join() === 'Send back,Drop' && pq.on === P1 && !pq.keepIn, JSON.stringify(pq));
|
|
124
135
|
ok('A1c the undo and mode notes sit behind the ⓘ line', pq.notes === true && /Nothing changes a record until you keep it/.test(ptxt));
|
|
125
|
-
await click('#
|
|
136
|
+
await click('#czViewer .cz-vw-body [data-bda="pinfo"]');
|
|
126
137
|
ok('A1d the ⓘ line opens the notes', await until(() => p.evaluate(() => !document.querySelector('#pcNotes').hidden && /None of the three can be undone/.test(document.querySelector('#pcNotes').textContent) && /agent mode/.test(document.querySelector('#pcNotes').textContent))));
|
|
127
|
-
await click(`#
|
|
128
|
-
ok('A1e pressing a card chooses it for the bottom bar', await until(() => p.evaluate((id) => document.querySelector('#
|
|
129
|
-
await click(`#
|
|
138
|
+
await click(`#czViewer .cz-vw-body .pcard[data-id="${P3}"]`);
|
|
139
|
+
ok('A1e pressing a card chooses it for the bottom bar', await until(() => p.evaluate((id) => document.querySelector('#czViewer .cz-vw-body .pcard.on').dataset.id === id && document.querySelector('#czViewer .cz-vw-body .pc-bar [data-bda="pkeep"]').dataset.id === id, P3)));
|
|
140
|
+
await click(`#czViewer .cz-vw-body .pcard[data-id="${P1}"] [data-bda="psel"]`);
|
|
130
141
|
await click(`.pc-bar [data-bda="pkeep"][data-id="${P1}"]`);
|
|
131
142
|
await until(() => posts.some((x) => x.path === '/api/driver/keep'));
|
|
132
143
|
const keep = posts.find((x) => x.path === '/api/driver/keep');
|
|
133
144
|
ok('A2 Keep posts one keep for that proposal and the ledger holds it', keep && keep.body.proposal === P1 && keep.body.ws === ws, JSON.stringify(keep));
|
|
134
145
|
await until(() => p.evaluate((id) => /Kept\./.test((document.querySelector(`.bd-it[data-id="${id}"] .bd-done`) || {}).textContent || ''), P1));
|
|
135
146
|
ok('A3 the proposal stays, marked Kept, and says what was recorded', /Kept\. /.test(await p.evaluate((id) => document.querySelector(`.bd-it[data-id="${id}"]`).textContent, P1)));
|
|
136
|
-
await click(`#
|
|
147
|
+
await click(`#czViewer .cz-vw-body .pcard[data-id="${P2}"]`);
|
|
137
148
|
await click(`.pc-bar [data-bda="pnote"][data-id="${P2}"]`);
|
|
138
149
|
const backBtn = () => p.evaluate((id) => { const b = document.querySelector(`[data-bda="pback"][data-id="${id}"]`); return b ? b.disabled : null; }, P2);
|
|
139
150
|
ok('A4 Send back opens a note box and the press is off until there is a note', await backBtn() === true);
|
|
140
151
|
const before = posts.length;
|
|
141
152
|
await p.evaluate((id) => { const b = document.querySelector(`[data-bda="pback"][data-id="${id}"]`); b.disabled = false; b.click(); }, P2);
|
|
142
|
-
await until(() => p.evaluate(() => /Write one line for the agent/.test((document.querySelector('#
|
|
153
|
+
await until(() => p.evaluate(() => /Write one line for the agent/.test((document.querySelector('#czViewer .cz-vw-body .bd-a') || {}).textContent || '')));
|
|
143
154
|
ok('A5 Send back without a note is refused on the page and posts nothing', posts.length === before);
|
|
144
155
|
await p.fill(`[data-bdn="${P2}"]`, 'Wait until the evidence is in.');
|
|
145
156
|
ok('A6 typing a note turns the press on', await backBtn() === false);
|
|
@@ -147,24 +158,25 @@ const GANTT = [
|
|
|
147
158
|
await until(() => posts.some((x) => x.path === '/api/driver/return'));
|
|
148
159
|
const ret = posts.find((x) => x.path === '/api/driver/return');
|
|
149
160
|
ok('A7 Send back posts return with the note', ret && ret.body.proposal === P2 && ret.body.note === 'Wait until the evidence is in.', JSON.stringify(ret));
|
|
150
|
-
await click(`#
|
|
161
|
+
await click(`#czViewer .cz-vw-body .pcard[data-id="${P3}"]`);
|
|
151
162
|
await click(`.pc-bar [data-bda="pdrop"][data-id="${P3}"]`);
|
|
152
163
|
await until(() => posts.some((x) => x.path === '/api/driver/drop'));
|
|
153
164
|
ok('A8 Drop posts drop and says it counts as a correction', posts.some((x) => x.path === '/api/driver/drop' && x.body.proposal === P3) && await until(() => body().then((t) => /Dropped\. It counts as a correction/.test(t))), await body());
|
|
154
165
|
const open1 = (await (await fetch(`${F.BASE}/api/driver/open?target_kind=initiative&ws=${ws}`)).json()).targets || {};
|
|
155
166
|
ok('A9 the ledger no longer lists the three as open', !Object.values(open1).flat().some((x) => [P1, P2, P3].includes(x.id)), JSON.stringify(open1));
|
|
156
167
|
await close();
|
|
157
|
-
await
|
|
158
|
-
ok('A10 the
|
|
168
|
+
await open('prop');
|
|
169
|
+
ok('A10 the view now says no proposal waits', await until(() => say().then((t) => /^No proposal waits for you/.test(t))), await say());
|
|
170
|
+
await close();
|
|
159
171
|
|
|
160
172
|
/* M: mentions */
|
|
161
173
|
await open('men');
|
|
162
174
|
const mt = await body();
|
|
163
175
|
ok('M1 the dialog lists the three mentions with the person, quote, place and the reply words', /Dana Hartono/.test(mt) && /Priya Sen/.test(mt) && /Lia Ong/.test(mt) && /Which day can the engineers use the sandbox/.test(mt) && /Refunds are paid within 14 days/.test(mt) && /Needs your reply/.test(mt) && /For your information/.test(mt), mt);
|
|
164
|
-
const tabs = await p.evaluate(() => [...document.querySelectorAll('#
|
|
176
|
+
const tabs = await p.evaluate(() => [...document.querySelectorAll('#czViewer .cz-vw-body [data-bda="mtab"]')].map((b) => b.textContent));
|
|
165
177
|
ok('M2 the tabs count by source', tabs.join() === 'All 3,Slack 1,Jira 1,Confluence 1', tabs.join());
|
|
166
178
|
await click('[data-bda="mtab"][data-k="jira"]');
|
|
167
|
-
ok('M3 a tab shows only that source', await p.evaluate(() => document.querySelectorAll('#
|
|
179
|
+
ok('M3 a tab shows only that source', await p.evaluate(() => document.querySelectorAll('#czViewer .cz-vw-body .bd-it').length === 1 && /Priya Sen/.test(document.querySelector('#czViewer .cz-vw-body .bd-a').textContent)));
|
|
168
180
|
await click('[data-bda="mtab"][data-k="all"]');
|
|
169
181
|
const link = await p.evaluate((id) => { const a = document.querySelector(`.bd-it[data-id="${id}"] a[data-bdlink]`); return a ? [a.getAttribute('href'), a.target, a.rel, a.textContent] : null; }, M1);
|
|
170
182
|
ok('M4 Open in Slack is the mention\'s https link in a new tab', link && link[0] === 'https://acme.slack.com/archives/D01/p1' && link[1] === '_blank' && /noopener/.test(link[2]) && link[3] === 'Open in Slack', JSON.stringify(link));
|
|
@@ -182,8 +194,8 @@ const GANTT = [
|
|
|
182
194
|
await click(`.bd-it[data-id="${M2}"] [data-bda="munread"]`);
|
|
183
195
|
await until(() => posts.filter((x) => x.path === '/api/mentions/read').length === 2);
|
|
184
196
|
ok('M8 Mark unread posts read:false', posts.filter((x) => x.path === '/api/mentions/read')[1].body.read === false);
|
|
197
|
+
ok('M9 the view names who waits again after Mark unread', await until(() => say().then((t) => /Dana in Slack and Priya in Jira are waiting/.test(t))), await say());
|
|
185
198
|
await close();
|
|
186
|
-
ok('M9 the row names who waits again after Mark unread', await until(() => rows().then((r) => /Dana in Slack and Priya in Jira are waiting/.test(r.men.t))), JSON.stringify((await rows()).men));
|
|
187
199
|
|
|
188
200
|
/* P: portfolio pulse */
|
|
189
201
|
await open('pulse');
|
|
@@ -192,8 +204,8 @@ const GANTT = [
|
|
|
192
204
|
ok('P2 the late one is first, with the Calendar\'s words', /Delayed \+6 d/.test(pt) && /Forecast \d{4}-\d\d-\d\d vs promised \d{4}-\d\d-\d\d/.test(pt) && pt.indexOf('Partner API onboarding') < pt.indexOf('Self-serve sandbox'), pt);
|
|
193
205
|
ok('P3 a Jira-only row says x of y done in Jira', /3 of 8 done in Jira; no promised date/.test(pt), pt);
|
|
194
206
|
ok('P4 the page says the status is the Calendar\'s and not a forecast of its own', /not a forecast of its own/.test(pt));
|
|
195
|
-
const hrefs = await p.evaluate(() => [...document.querySelectorAll('#
|
|
196
|
-
ok('P5 Open the initiative goes to the
|
|
207
|
+
const hrefs = await p.evaluate(() => [...document.querySelectorAll('#czViewer .cz-vw-body a.cta')].map((a) => a.getAttribute('href')));
|
|
208
|
+
ok('P5 Open the initiative goes to the initiative on Home', hrefs.length === 4 && hrefs.every((h) => /^\/premium\.html\?ini=/.test(h)), hrefs.join());
|
|
197
209
|
await shot('pulse-1280-light');
|
|
198
210
|
const n0 = posts.length; await close();
|
|
199
211
|
ok('P6 the pulse wrote nothing', posts.length === n0);
|
|
@@ -204,7 +216,7 @@ const GANTT = [
|
|
|
204
216
|
ok('S1 the dialog shows when the scan last ran, when it runs next, a report and its proposals', /Last scan/.test(st) && /Next/.test(st) && /report/i.test(st) && /Dismiss asks for a reason and counts as a correction/.test(st), st);
|
|
205
217
|
ok('S2 each proposal says what Approve does before the press', /Approve creates the initiative in the first stage of the .* workflow\.|Start the research starts a research scan|Approve writes an evidence line on/.test(st), st);
|
|
206
218
|
await shot('scan-1280-light');
|
|
207
|
-
const dis = await p.evaluate(() => { const b = document.querySelector('#
|
|
219
|
+
const dis = await p.evaluate(() => { const b = document.querySelector('#czViewer .cz-vw-body [data-bda="sdisopen"]'); return b ? b.dataset.id : null; });
|
|
208
220
|
await click(`[data-bda="sdisopen"][data-id="${dis}"]`);
|
|
209
221
|
ok('S3a Dismiss asks for a reason and is off until there is one', await p.evaluate((id) => document.querySelector(`[data-bda="sdis"][data-id="${id}"]`).disabled, dis));
|
|
210
222
|
await p.fill(`[data-bds="${dis}"]`, 'We already decided this.');
|
|
@@ -218,7 +230,7 @@ const GANTT = [
|
|
|
218
230
|
await click(`[data-bda="sundo"][data-id="${dis}"]`);
|
|
219
231
|
await until(() => posts.some((x) => x.path === '/api/scan/proposal' && x.body.action === 'undo'));
|
|
220
232
|
ok('S5 Undo posts undo and the proposal waits again', await until(() => p.evaluate((id) => !!document.querySelector(`.bd-it[data-id="${id}"] [data-bda="sdisopen"]`), dis)));
|
|
221
|
-
const app = await p.evaluate(() => { const b = [...document.querySelectorAll('#
|
|
233
|
+
const app = await p.evaluate(() => { const b = [...document.querySelectorAll('#czViewer .cz-vw-body [data-bda="sapp"]')].find((x) => x.textContent === 'Approve'); return b ? b.dataset.id : null; });
|
|
222
234
|
if (app) {
|
|
223
235
|
await click(`[data-bda="sapp"][data-id="${app}"]`);
|
|
224
236
|
await until(() => posts.some((x) => x.path === '/api/scan/proposal' && x.body.action === 'approve'));
|
|
@@ -226,47 +238,48 @@ const GANTT = [
|
|
|
226
238
|
await until(() => p.evaluate((id) => /Approved\./.test((document.querySelector(`.bd-it[data-id="${id}"]`) || {}).textContent || ''), app) || /did not go through|Dismissed|SERR/.test(''), 8000);
|
|
227
239
|
ok('S7 an approval says what it did, or the server\'s reason', /Approved\. |already|cannot|could not|not found|no such/i.test(await p.evaluate((id) => (document.querySelector(`.bd-it[data-id="${id}"]`) || {}).textContent || '', app)), await body());
|
|
228
240
|
} else ok('S6 the scan holds an Approve proposal', false, st);
|
|
229
|
-
const snowOff = await p.evaluate(() => { const b = document.querySelector('#
|
|
241
|
+
const snowOff = await p.evaluate(() => { const b = document.querySelector('#czViewer .cz-vw-body [data-bda="snow"]'); return b ? b.disabled : null; });
|
|
230
242
|
ok('S8 Scan now says before the press that it starts an agent that reads the web and the repository', /Scan now starts an agent that reads the public web/.test(await body()) && snowOff !== null);
|
|
231
243
|
if (snowOff === false) {
|
|
232
|
-
await click('#
|
|
244
|
+
await click('#czViewer .cz-vw-body [data-bda="snow"]');
|
|
233
245
|
await until(() => posts.some((x) => x.path === '/api/scan/now'));
|
|
234
246
|
ok('S9 Scan now posts one scan/now for the product', posts.filter((x) => x.path === '/api/scan/now').length === 1 && posts.find((x) => x.path === '/api/scan/now').body.ws === ws);
|
|
235
247
|
} else ok('S9 Scan now is off and says why', /switched off|cannot start|left/.test(await body()), await body());
|
|
236
248
|
await close();
|
|
237
249
|
|
|
238
|
-
/* F: data freshness */
|
|
239
|
-
await
|
|
240
|
-
|
|
241
|
-
const
|
|
242
|
-
|
|
250
|
+
/* F: data freshness is Sources now (cozy-sources.js); the old view's key opens it */
|
|
251
|
+
await p.evaluate(() => import('/pm/home-around.js').then((M) => M.openAround('src')));
|
|
252
|
+
await until(() => p.evaluate(() => document.querySelectorAll('#czViewer .ev-src .ev-trow[data-src]').length > 0), 20000);
|
|
253
|
+
const ft = await p.evaluate(() => document.querySelector('#czViewer .ev-src').textContent);
|
|
254
|
+
const srcRows = await p.evaluate(() => document.querySelectorAll('#czViewer .ev-src .ev-trow[data-src]').length);
|
|
255
|
+
ok('F1 Sources lists the workspace\'s sources with when each was last read, and says it never posts', srcRows >= 3 && /Last read/.test(ft) && /never posts to them/.test(ft) && !/up to date/i.test(ft), ft);
|
|
243
256
|
await shot('src-1280-light');
|
|
244
|
-
const one = await p.evaluate(() => { const b = document.querySelector('#
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
257
|
+
const one = await p.evaluate(() => { const b = document.querySelector('#czViewer .ev-src [data-ev-read]'); return b ? b.dataset.evRead : null; });
|
|
258
|
+
if (one) {
|
|
259
|
+
await click(`#czViewer .ev-src [data-ev-read="${one}"]`);
|
|
260
|
+
await until(() => posts.some((x) => x.path === '/api/sources/refresh'));
|
|
261
|
+
const rf = posts.filter((x) => x.path === '/api/sources/refresh');
|
|
262
|
+
ok('F2 Read again posts one sources/refresh for that source', rf.length === 1 && rf[0].body.source === one && rf[0].body.ws === ws, JSON.stringify(rf));
|
|
263
|
+
ok('F3 it says what it started', await until(() => p.evaluate(() => /agent session started|Reading it again/.test(document.querySelector('#czViewer .ev-src').textContent))));
|
|
264
|
+
} else ok('F2 no source is behind, so no row offers Read again', !/Read again/.test(ft.replace(/Read all again/g, '')), ft);
|
|
265
|
+
const all = await p.evaluate(() => { const b = document.querySelector('#czViewer .ev-src [data-ev-all]'); return b ? b.disabled : null; });
|
|
252
266
|
if (all === false) {
|
|
253
267
|
const n1 = posts.filter((x) => x.path === '/api/sources/refresh').length;
|
|
254
|
-
await click('#
|
|
268
|
+
await click('#czViewer .ev-src [data-ev-all]');
|
|
255
269
|
await until(() => posts.some((x) => x.path === '/api/sources/refresh-all'));
|
|
256
270
|
const made = posts.filter((x) => x.path === '/api/sources/refresh-all');
|
|
257
|
-
ok('F4
|
|
258
|
-
} else ok('F4
|
|
259
|
-
await
|
|
271
|
+
ok('F4 Read all again posts one ordered run (the sources, then the Briefing), and no refresh of each source', made.length === 1 && made[0].body.ws === ws && posts.filter((x) => x.path === '/api/sources/refresh').length === n1, JSON.stringify(made));
|
|
272
|
+
} else ok('F4 Read all again is off while a run is going', all === true, String(all));
|
|
273
|
+
await p.keyboard.press('Escape'); await until(() => p.evaluate(() => !document.querySelector('#czViewer:not([hidden])')));
|
|
260
274
|
|
|
261
275
|
/* E: a source that fails is named, never shown empty */
|
|
262
276
|
ganttFail = true;
|
|
263
277
|
await p.evaluate(() => { document.dispatchEvent(new Event('visibilitychange')); });
|
|
264
278
|
await p.reload();
|
|
265
|
-
await
|
|
266
|
-
const RE = await rows();
|
|
267
|
-
ok('E1 a pulse that cannot be read says so, and does not read "nothing"', /^Portfolio pulse (could not be read|cannot be read|did not answer|failed)|could not be read/.test(RE.pulse.t) && !/nothing to compare/.test(RE.pulse.t), JSON.stringify(RE.pulse));
|
|
279
|
+
await openCard();
|
|
268
280
|
await open('pulse');
|
|
269
|
-
ok('
|
|
281
|
+
ok('E1 a pulse that cannot be read says so, and does not read "nothing"', /could not be read/.test(await say()) && !/nothing to compare/.test(await body()), await say());
|
|
282
|
+
ok('E2 its dialog names the failure', /could not be read|Portfolio pulse/.test(await body()) && await p.evaluate(() => !!document.querySelector('#czViewer .cz-vw-body .nodef.err')), await body());
|
|
270
283
|
await close();
|
|
271
284
|
ganttFail = false;
|
|
272
285
|
|
|
@@ -277,20 +290,19 @@ const GANTT = [
|
|
|
277
290
|
];
|
|
278
291
|
repReply = { ok: true, ws, setups: [], asks: [], findings: FIND, finder: { cadence: 'daily', sources: {}, last_run: null, next_run: null } };
|
|
279
292
|
await p.reload();
|
|
280
|
-
await
|
|
281
|
-
const RG = await rows();
|
|
282
|
-
ok('G1 two findings make the row say so, with the count', /^2 reports found in your work/.test(RG.rep.t) && RG.rep.m === '2', JSON.stringify(RG.rep));
|
|
293
|
+
await openCard();
|
|
283
294
|
await open('rep');
|
|
295
|
+
ok('G1 two findings make the view say so, with the count', /^2 reports were found in your work/.test(await say()), await say());
|
|
284
296
|
const gb = await body();
|
|
285
297
|
ok('G2 the dialog shows each finding with its why, its evidence and its confidence word', /Weekly status/.test(gb) && /every Friday for six weeks/.test(gb) && /Mail: Weekly status, 6 times/.test(gb) && /Calendar: Friday review/.test(gb) && /Likely/.test(gb) && /Not sure/.test(gb), gb);
|
|
286
|
-
ok('G3 the buttons say what they record before they are pressed', /PMOS drafts only\. Nothing is sent\./.test(gb) && /will not raise it again/.test(gb) && !/Change first/.test(await p.evaluate(() => [...document.querySelectorAll('#
|
|
298
|
+
ok('G3 the buttons say what they record before they are pressed', /PMOS drafts only\. Nothing is sent\./.test(gb) && /will not raise it again/.test(gb) && !/Change first/.test(await p.evaluate(() => [...document.querySelectorAll('#czViewer .cz-vw-body .bd-a button')].map((b) => b.textContent).join('|'))), gb);
|
|
287
299
|
const g0 = posts.length;
|
|
288
|
-
await click('#
|
|
300
|
+
await click('#czViewer .cz-vw-body [data-id="f-weekly"] [data-bda="rset"]');
|
|
289
301
|
await until(() => posts.some((x) => x.path === '/api/report-setups/setup'));
|
|
290
302
|
const ps = posts.slice(g0).find((x) => x.path === '/api/report-setups/setup');
|
|
291
303
|
ok('G4 Set up posts the finding and the product, nothing more', ps && JSON.stringify(Object.keys(ps.body).sort()) === JSON.stringify(['finding', 'ws']) && ps.body.finding === 'f-weekly', JSON.stringify(ps));
|
|
292
304
|
ok('G5 after Set up the dialog names the report that was set up and that nothing was sent', await until(async () => /Set up as Weekly status\..*Nothing was sent/.test(await body())), await body());
|
|
293
|
-
await click('#
|
|
305
|
+
await click('#czViewer .cz-vw-body [data-id="f-qbr"] [data-bda="rno"]');
|
|
294
306
|
await until(() => posts.some((x) => x.path === '/api/report-setups/dismiss'));
|
|
295
307
|
const pd = posts.find((x) => x.path === '/api/report-setups/dismiss');
|
|
296
308
|
ok('G6 Not a report posts the finding, its name and the product', pd && pd.body.finding === 'f-qbr' && pd.body.name === 'Quarterly review' && pd.body.ws === ws && Object.keys(pd.body).length === 3, JSON.stringify(pd));
|
|
@@ -298,24 +310,24 @@ const GANTT = [
|
|
|
298
310
|
repReply = { ok: true, ws, setups: [], asks: [], findings: [FIND[1]], finder: { cadence: 'daily', sources: {}, last_run: null, next_run: null } };
|
|
299
311
|
repFail = true;
|
|
300
312
|
await p.reload();
|
|
301
|
-
await
|
|
302
|
-
const R1f = await rows();
|
|
303
|
-
ok('G7 one finding is named in the row', /^Report found: Quarterly review/.test(R1f.rep.t), JSON.stringify(R1f.rep));
|
|
313
|
+
await openCard();
|
|
304
314
|
await open('rep');
|
|
305
|
-
|
|
306
|
-
|
|
315
|
+
ok('G7 one finding is named in the view', /^1 report was found/.test(await say()) && /Quarterly review/.test(await body()), await say());
|
|
316
|
+
await click('#czViewer .cz-vw-body [data-bda="rset"]');
|
|
317
|
+
ok('G8 a refused press shows the reason and keeps the finding', await until(async () => /no longer open/.test(await body()) && await p.evaluate(() => !!document.querySelector('#czViewer .cz-vw-body .nodef.err') && !!document.querySelector('#czViewer .cz-vw-body [data-bda="rset"]'))), await body());
|
|
307
318
|
await close();
|
|
308
319
|
repFail = false;
|
|
309
320
|
repReply = { ok: true, ws, setups: [], asks: [], findings: [], finder: { cadence: 'off', sources: {}, last_run: null, next_run: null } };
|
|
310
321
|
await p.reload();
|
|
311
|
-
await
|
|
312
|
-
|
|
313
|
-
ok('G9 with none found
|
|
322
|
+
await openCard();
|
|
323
|
+
await open('rep');
|
|
324
|
+
ok('G9 with none found, the view says no report waits', /^No report waits for you/.test(await say()), await say());
|
|
325
|
+
await close();
|
|
314
326
|
repReply = null;
|
|
315
327
|
|
|
316
328
|
/* W: the POST allow-list */
|
|
317
|
-
const allowed = new Set(['/api/mentions/read', '/api/pm-items/add', '/api/driver/keep', '/api/driver/return', '/api/driver/drop', '/api/scan/proposal', '/api/scan/now', '/api/scan/stop', '/api/sources/refresh', '/api/sources/refresh-all', '/api/report-setups/setup', '/api/report-setups/dismiss', '/api/briefing-premium/seen']); // seen: an opened popup's record (popup context slice 11, R1)
|
|
318
|
-
const strays = posts.filter((x) => !allowed.has(x.path));
|
|
329
|
+
const allowed = new Set(['/api/mentions/read', '/api/pm-items/add', '/api/driver/keep', '/api/driver/return', '/api/driver/drop', '/api/scan/proposal', '/api/scan/now', '/api/scan/stop', '/api/sources/refresh', '/api/sources/refresh-all', '/api/report-setups/setup', '/api/report-setups/dismiss', '/api/briefing-premium/seen', '/api/news-for-you/seen']); // news-for-you/seen: closing New for you marks what it showed seen // seen: an opened popup's record (popup context slice 11, R1)
|
|
330
|
+
const strays = posts.filter((x) => !allowed.has(x.path) && !/^\/api\/home-desk\//.test(x.path)); // /api/home-desk/*: Home's own chat (a conversation seen), not Around you
|
|
319
331
|
ok('W1 every POST is one of the existing routes in the PRD', posts.length > 0 && strays.length === 0, JSON.stringify(strays));
|
|
320
332
|
const fields = { '/api/driver/keep': ['ws', 'proposal'], '/api/driver/return': ['ws', 'proposal', 'note'], '/api/driver/drop': ['ws', 'proposal'], '/api/mentions/read': ['id', 'read'], '/api/pm-items/add': ['line'], '/api/scan/proposal': ['ws', 'id', 'action', 'why'], '/api/scan/now': ['ws'], '/api/sources/refresh': ['ws', 'source'], '/api/sources/refresh-all': ['ws'], '/api/report-setups/setup': ['ws', 'finding'], '/api/report-setups/dismiss': ['ws', 'finding', 'name'] };
|
|
321
333
|
const extra = posts.filter((x) => fields[x.path] && Object.keys(x.body || {}).some((k) => !fields[x.path].includes(k)));
|
|
@@ -323,35 +335,37 @@ const GANTT = [
|
|
|
323
335
|
ok('W3 every GET the card made is a console route in the PRD', gets.filter((g) => !['/api/briefing-premium', '/api/brief-page', '/api/driver/open', '/api/calendar-views', '/api/scan/portfolio', '/api/report-setups', '/api/sources', '/api/pm-items', '/api/workspaces', '/api/products', '/api/state'].includes(g) && /around|depth|bd-/.test(g)).length === 0);
|
|
324
336
|
|
|
325
337
|
/* the Scan now status on the scan row, from the server's own manual count */
|
|
326
|
-
ok('RS1 the scan
|
|
338
|
+
ok('RS1 the scan view says how many manual scans are left, or why Scan now is off', /\d+ of \d+ manual scans left today|switched off|cannot start/.test(st), st);
|
|
327
339
|
|
|
328
340
|
/* P: the prep ring over Today, counted from the meetings the brief page holds */
|
|
329
341
|
const tm = (id, m, state, before) => ({ id, title: 'Meeting ' + id, start: iso(m), end: iso(m + 30), minutes: 30, people: [], initiative: null, prepared: false, before, state });
|
|
330
342
|
const TODAY = [tm('a', -90, 'past', []), tm('b', 20, 'next', []), tm('c', 120, 'later', [{ id: 'x1', title: 'Send the deck', due: null }]), tm('d', 200, 'later', [])];
|
|
331
343
|
await p.route('**/api/brief-page*', async (r) => { const res = await r.fetch(); const b = await res.json(); json(r, { ...b, today: TODAY }); });
|
|
332
344
|
await p.goto(`${F.BASE}/premium.html?ws=${encodeURIComponent(ws)}`);
|
|
333
|
-
await
|
|
345
|
+
await openCard();
|
|
346
|
+
await until(() => p.evaluate(() => { const c = document.querySelector('#czViewer #prep'); return c && !c.hidden && /prepped/.test(c.textContent); }), 30000);
|
|
334
347
|
const prep = await p.evaluate(() => { const c = document.querySelector('#prep'); return { t: c.textContent, ring: !!c.querySelector('circle.rg'), l: c.querySelector('svg').getAttribute('aria-label') }; });
|
|
335
348
|
ok('PR1 the ring counts the meetings left and those with nothing to do before them', /Meeting b at \d\d:\d\d is next/.test(prep.t) && /3 meetings left today\. 2 of 3 prepped\./.test(prep.t) && prep.ring && prep.l === '2 of 3 prepped', JSON.stringify(prep));
|
|
336
|
-
|
|
337
|
-
await p.
|
|
338
|
-
await
|
|
339
|
-
|
|
349
|
+
// Home has no day strip (another day is the Calendar's, in the Viewer): the ring is not shown when no meeting is left today
|
|
350
|
+
await p.unroute('**/api/brief-page*');
|
|
351
|
+
await p.route('**/api/brief-page*', async (r) => { const res = await r.fetch(); const b = await res.json(); json(r, { ...b, today: TODAY.map((m) => ({ ...m, state: 'past' })) }); });
|
|
352
|
+
await p.reload(); await openCard();
|
|
353
|
+
ok('PR2 the ring is not shown when no meeting is left today', await p.evaluate(() => { const c = document.querySelector('#czViewer #prep'); return !!c && c.hidden; }));
|
|
340
354
|
await p.unroute('**/api/brief-page*');
|
|
341
355
|
|
|
342
356
|
/* L: floors */
|
|
343
357
|
await p.goto(`${F.BASE}/premium.html?ws=${encodeURIComponent(ws)}`);
|
|
344
|
-
await
|
|
358
|
+
await openCard();
|
|
345
359
|
await p.setViewportSize({ width: 390, height: 844 }); await sleep(300);
|
|
346
360
|
await shot('card-390-light');
|
|
347
361
|
const side = await p.evaluate(() => document.documentElement.scrollWidth - innerWidth);
|
|
348
362
|
ok('L1 at 390 wide the page does not scroll sideways', side <= 0, String(side));
|
|
349
|
-
const small = await p.evaluate(() => [...document.querySelectorAll('#
|
|
363
|
+
const small = await p.evaluate(() => [...document.querySelectorAll('#czViewer .ev-news [data-ev-rest]')].filter((b) => b.getBoundingClientRect().height < 44).map((b) => b.dataset.evRest));
|
|
350
364
|
ok('L2 every row is 44 px tall at least', small.length === 0, small.join());
|
|
351
365
|
await open('men');
|
|
352
|
-
const wide = await p.evaluate(() => { const d = document.querySelector('#
|
|
366
|
+
const wide = await p.evaluate(() => { const d = document.querySelector('#czViewer .cz-vw-body'); return [document.documentElement.scrollWidth - innerWidth, d.scrollWidth - d.clientWidth]; });
|
|
353
367
|
await shot('men-390-light');
|
|
354
|
-
const sm2 = await p.evaluate(() => [...document.querySelectorAll('#
|
|
368
|
+
const sm2 = await p.evaluate(() => [...document.querySelectorAll('#czViewer .cz-vw-body .bd-a button, #czViewer .cz-vw-body .bd-a a.cta')].filter((b) => b.offsetParent && b.getBoundingClientRect().height < 44).map((b) => b.textContent));
|
|
355
369
|
ok('L3 a dialog at 390 wide does not scroll sideways and its buttons are 44 px tall', wide[0] <= 0 && wide[1] <= 1 && sm2.length === 0, wide.join() + ' ' + sm2.join());
|
|
356
370
|
await close();
|
|
357
371
|
await p.setViewportSize({ width: 1280, height: 900 });
|
|
@@ -359,9 +373,9 @@ const GANTT = [
|
|
|
359
373
|
await shot('card-1280-dark');
|
|
360
374
|
await open('prop').catch(() => {});
|
|
361
375
|
await close().catch(() => {});
|
|
362
|
-
const raw = await p.evaluate(() => { const c = getComputedStyle(document.querySelector('#
|
|
376
|
+
const raw = await p.evaluate(() => { const c = getComputedStyle(document.querySelector('#czViewer')); return [c.backgroundColor, getComputedStyle(document.body).backgroundColor]; });
|
|
363
377
|
ok('L4 in the dark theme the card has a background of its own', raw[0] !== 'rgba(0, 0, 0, 0)' && raw[0] !== raw[1] || raw[0] !== '', raw.join());
|
|
364
|
-
const focus = await p.evaluate(() => { const b = document.querySelector('#
|
|
378
|
+
const focus = await p.evaluate(() => { const b = document.querySelector('#czViewer .ev-news [data-ev-rest]'); b.focus(); const c = getComputedStyle(b); return [c.outlineStyle, c.outlineWidth, c.boxShadow]; });
|
|
365
379
|
ok('L5 a row shows a focus ring', focus[0] !== 'none' || focus[2] !== 'none', focus.join());
|
|
366
380
|
/* K: the simple Agent proposals dialog at 390, light and dark, and with the phone keyboard open */
|
|
367
381
|
const P4 = 'p-bbbbbbbb04', P5 = 'p-bbbbbbbb05';
|
|
@@ -370,10 +384,10 @@ const GANTT = [
|
|
|
370
384
|
for (const [w, h, dark] of [[1280, 900, true], [390, 844, false], [390, 844, true]]) {
|
|
371
385
|
await p.emulateMedia({ colorScheme: dark ? 'dark' : 'light' }); await p.setViewportSize({ width: w, height: h });
|
|
372
386
|
await p.goto(`${F.BASE}/premium.html?ws=${encodeURIComponent(ws)}`);
|
|
373
|
-
await
|
|
374
|
-
await open('prop'); await until(() => p.$('#
|
|
387
|
+
await openCard();
|
|
388
|
+
await open('prop'); await until(() => p.$('#czViewer .cz-vw-body .pc-bar')); await sleep(800);
|
|
375
389
|
if (w === 390) {
|
|
376
|
-
const k = await p.evaluate(() => { const d = document.querySelector('#
|
|
390
|
+
const k = await p.evaluate(() => { const d = document.querySelector('#czViewer .cz-vw-body'), bar = document.querySelector('#czViewer .cz-vw-body .pc-bar').getBoundingClientRect(); return { side: [document.documentElement.scrollWidth - innerWidth, d.scrollWidth - d.clientWidth], bar: [Math.round(bar.left), Math.round(bar.right), Math.round(bar.bottom)], small: [...document.querySelectorAll('#czViewer .cz-vw-body .pc-bar button')].filter((b) => b.getBoundingClientRect().height < 44).length }; });
|
|
377
391
|
ok(`K1 ${dark ? 'dark' : 'light'} at 390 the proposals dialog does not scroll sideways, its bar fits and its buttons are 44 px tall`, k.side[0] <= 0 && k.side[1] <= 1 && k.bar[0] >= 0 && k.bar[1] <= 390 && k.bar[2] <= 844 && k.small === 0, JSON.stringify(k));
|
|
378
392
|
}
|
|
379
393
|
await shot(`props-${w}-${dark ? 'dark' : 'light'}`);
|