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,25 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
|
-
/* briefing-premium-calendar-test.js — the
|
|
4
|
-
* planning/prd/briefing-premium-calendar-prd.md C1 to C10
|
|
5
|
-
*
|
|
6
|
-
*
|
|
3
|
+
/* briefing-premium-calendar-test.js — the calendar's day strip and a meeting opened from it (initiative premium-calendar-card and
|
|
4
|
+
* briefing-premium-calendar, slice 1; planning/prd/briefing-premium-calendar-prd.md C1 to C10; re-pointed for premium-agreed-design, area viewer:
|
|
5
|
+
* the calendar and the meeting open in the Viewer card, /premium-viewer.html, not in the old Briefing card and dialog). Serves the real page from
|
|
6
|
+
* the real server; the calendar, the notes, Focus, the replay and the material are answered by stand-ins (fixtures/premium-viewer-fixtures.js),
|
|
7
|
+
* so each press can be read off the request the page sent. Home's own calendar card (its title and fold) is Home's to test.
|
|
8
|
+
* C1 the strip · C2 the day · C3 honest states · C4 a meeting · C5 link it · C6 notes · C7 material · C8 replay · C9 only the link write · C10 floors
|
|
7
9
|
* Every wait polls the page; no fixed sleep stands in for a state. */
|
|
8
|
-
const fs = require('fs');
|
|
9
10
|
const path = require('path');
|
|
10
11
|
const { spawn } = require('child_process');
|
|
11
12
|
const { findBrowser } = require('./lib/find-browser');
|
|
12
|
-
const CT = require('./lib/premium-console-type'); // the mockup is read with the console's type (PM, 2026-10-19), as premium.css is
|
|
13
|
-
const CT_VENDOR = 'file://' + path.join(__dirname, 'public', 'vendor') + '/';
|
|
14
13
|
const T = require('./test-run').configure({ name: 'briefing-premium-calendar' });
|
|
15
|
-
const
|
|
16
|
-
const F = require('./fixtures/briefing-premium-facts.js');
|
|
14
|
+
const F = require('./fixtures/premium-viewer-fixtures.js');
|
|
17
15
|
|
|
18
|
-
const BASE = T.BASE;
|
|
19
|
-
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
20
|
-
const until = async (fn, ms = 10000, step = 100) => { const t0 = Date.now(); for (;;) { const v = await fn(); if (v) return v; if (Date.now() - t0 > ms) return v; await sleep(step); } };
|
|
16
|
+
const BASE = T.BASE, until = F.until;
|
|
21
17
|
const results = [];
|
|
22
|
-
const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + extra : ''}`); };
|
|
18
|
+
const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + String(extra).slice(0, 500) : ''}`); };
|
|
23
19
|
let srv = null; let browser = null;
|
|
24
20
|
const finish = async (code) => {
|
|
25
21
|
if (browser) await browser.close().catch(() => {});
|
|
@@ -30,33 +26,7 @@ const finish = async (code) => {
|
|
|
30
26
|
process.exit(code !== undefined ? code : (bad ? 1 : 0));
|
|
31
27
|
};
|
|
32
28
|
process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
33
|
-
|
|
34
|
-
const pad = (n) => String(n).padStart(2, '0');
|
|
35
|
-
const dayKey = (d) => `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`;
|
|
36
|
-
const iso = (d) => { const off = -d.getTimezoneOffset(), a = Math.abs(off); return `${dayKey(d)}T${pad(d.getHours())}:${pad(d.getMinutes())}:00${off >= 0 ? '+' : '-'}${pad(Math.floor(a / 60))}:${pad(a % 60)}`; };
|
|
37
|
-
const NOW = new Date();
|
|
38
|
-
const at = (h, m, plus = 0) => { const d = new Date(NOW.getFullYear(), NOW.getMonth(), NOW.getDate() + plus, h, m, 0, 0); return d; };
|
|
39
|
-
const monday = () => { const d = new Date(NOW.getFullYear(), NOW.getMonth(), NOW.getDate()); d.setDate(d.getDate() - ((d.getDay() + 6) % 7)); return d; };
|
|
40
|
-
/* a weekday of this week that is not today: Tuesday when today is Monday, else Monday */
|
|
41
|
-
const OTHER = () => { const m = monday(); if (NOW.getDay() === 1) m.setDate(m.getDate() + 1); return m; };
|
|
42
|
-
const weekAnswer = () => {
|
|
43
|
-
const m = monday(), cells = [];
|
|
44
|
-
for (let i = 0; i < 7; i++) { const d = new Date(m.getFullYear(), m.getMonth(), m.getDate() + i); cells.push({ key: dayKey(d), start: dayKey(d), end: dayKey(d), events: [] }); }
|
|
45
|
-
const put = (d, e) => cells.find((c) => c.key === dayKey(d)).events.push(e);
|
|
46
|
-
/* today holds Sprint planning (the Today row); another day of the strip holds Checkout sync and Sprint planning (the rows a picked day lists) */
|
|
47
|
-
const o = (h, mm) => { const x = OTHER(); x.setHours(h, mm, 0, 0); return x; };
|
|
48
|
-
put(at(14, 0), { id: 'ev-sprint-today', at: iso(at(14, 0)), end: iso(at(15, 0)), title: 'Sprint planning', attendees: ['Dara', 'Priya', 'Sam'], series: 'sprint-planning' });
|
|
49
|
-
put(o(9, 30), { id: 'ev-checkout', at: iso(o(9, 30)), end: iso(o(10, 15)), title: 'Checkout sync', attendees: ['Priya', 'Dara'] });
|
|
50
|
-
put(o(14, 0), { id: 'ev-sprint', at: iso(o(14, 0)), end: iso(o(15, 0)), title: 'Sprint planning', attendees: ['Dara', 'Priya', 'Sam'], series: 'sprint-planning' });
|
|
51
|
-
const lvl = { phase: 'upcoming', level: { kind: 'board', ws: 'w1', id: 'idpf', name: 'IDPF', why: 'you linked it to the board', by: 'pm' } };
|
|
52
|
-
return { ok: true, view: 'week', range: { start: cells[0].key, end: cells[6].key }, cells, events_source: 'calendar-memory', today: dayKey(NOW),
|
|
53
|
-
context: { 'ev-sprint': lvl, 'ev-sprint-today': lvl },
|
|
54
|
-
link_boards: [{ ws: 'w1', id: 'idpf', name: 'IDPF' }, { ws: 'w1', id: 'pay', name: 'Payments' }], gantt: [{ id: 'premium-ux', title: 'Premium UX' }] };
|
|
55
|
-
};
|
|
56
|
-
const REPLAY = { ok: true, note: { id: 'n1', title: 'Sprint planning notes' }, meeting: { title: 'Sprint planning', attendees: ['Dara', 'Priya', 'Sam'] }, audio: { url: '/x', ms: 1500000 }, length_ms: 1500000, lines: [{}],
|
|
57
|
-
keys: [{ k: 'decision', text: 'Plan the sprint with eight people', state: 'draft' }, { k: 'action', text: 'Sam confirms the data fix owner', owner: 'Sam', due: 'Tue', state: 'owner' }, { k: 'question', text: 'Does a release eat the capacity?', state: 'open' }] };
|
|
58
|
-
const MATERIAL = { ok: true, key: 'k', items: [{ id: 'm1', kind: 'doc', ref: 'r', title: 'Capacity sheet', scope: 'series' }, { id: 'm2', kind: 'link', url: 'https://x.example', title: 'Roadmap', scope: 'meeting' }] };
|
|
59
|
-
const MOCKUP = fs.readFileSync(path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'briefing-artifact.html'), 'utf8');
|
|
29
|
+
const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'application/json', body: JSON.stringify(b) });
|
|
60
30
|
|
|
61
31
|
(async () => {
|
|
62
32
|
const exe = findBrowser();
|
|
@@ -66,172 +36,91 @@ const MOCKUP = fs.readFileSync(path.join(__dirname, '..', 'prototype', 'premium-
|
|
|
66
36
|
srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
|
|
67
37
|
await T.waitForServer(BASE);
|
|
68
38
|
browser = await chromium.launch({ executablePath: exe });
|
|
39
|
+
const W = F.world();
|
|
40
|
+
const tap = (p, sel) => p.$eval('#czViewer ' + sel, (b) => b.click());
|
|
41
|
+
const text = (p) => p.evaluate(() => (document.querySelector('#czViewer') || {}).innerText || '');
|
|
42
|
+
const weekReads = (S) => S.gets.filter((g) => g.startsWith('/api/calendar-views')).length;
|
|
43
|
+
const ALL = [];
|
|
44
|
+
const open = async (url, o) => { const X = await F.open(browser, BASE, url, { noLive: true, ...o }); ALL.push(X); return X; };
|
|
69
45
|
|
|
70
|
-
|
|
71
|
-
const
|
|
72
|
-
const ctx = await browser.newContext({ viewport: { width: w, height: h } });
|
|
73
|
-
const page = await ctx.newPage();
|
|
74
|
-
const S = { errors: [], reqs: [], posts: [], weekGets: [], replayGets: [] };
|
|
75
|
-
page.on('pageerror', (e) => S.errors.push(String((e && e.message) || e)));
|
|
76
|
-
page.on('request', (r) => { if (r.url().startsWith(BASE)) S.reqs.push(r.method() + ' ' + new URL(r.url()).pathname); });
|
|
77
|
-
const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'application/json', body: JSON.stringify(b) });
|
|
78
|
-
await page.route('**/api/briefing-premium*', (r) => json(r, { ok: true, state: 'ready', model: B.build(facts()), as_of: Date.now() }));
|
|
79
|
-
await page.route('**/api/calendar-views*', (r) => {
|
|
80
|
-
const q = new URL(r.request().url()).search;
|
|
81
|
-
if (/only=gantt/.test(q)) return json(r, { ok: true, view: 'quarter', gantt: [], no_plan: 0 }); // the Around you card's pulse, not the week
|
|
82
|
-
S.weekGets.push(q); json(r, week, week && week.ok === false ? 500 : 200);
|
|
83
|
-
});
|
|
84
|
-
await page.route('**/api/meeting-replay*', (r) => { S.replayGets.push(new URL(r.request().url()).search); if (replay === 404) json(r, { ok: false, error: 'no note for that meeting' }, 404); else json(r, replay); });
|
|
85
|
-
await page.route('**/api/meeting-material*', (r) => json(r, material));
|
|
86
|
-
await page.route('**/api/calendar-links', (r) => { S.posts.push(JSON.parse(r.request().postData() || '{}')); json(r, linkRes, linkRes.ok ? 200 : 403); });
|
|
87
|
-
await page.goto(BASE + '/premium.html?theme=' + theme);
|
|
88
|
-
S.up = await until(() => page.evaluate(() => document.querySelectorAll('#rank .rr').length > 0 && document.querySelectorAll('#tl .ev').length > 0), 20000);
|
|
89
|
-
return Object.assign(S, { ctx, page });
|
|
90
|
-
};
|
|
91
|
-
const strip = (p) => until(() => p.evaluate(() => document.querySelectorAll('#wkStrip [data-day]').length === 5));
|
|
92
|
-
const week = (p) => strip(p).then(() => p.click(`#wkStrip [data-day="${dayKey(OTHER())}"]`)).then(() => until(() => p.evaluate(() => !!document.querySelector('#tl .wkd') || /Calendar not read/.test(document.querySelector('#tl').textContent))));
|
|
93
|
-
|
|
94
|
-
const A = await open();
|
|
95
|
-
ok('0 the page draws the list and Today', A.up);
|
|
96
|
-
if (!A.up) return finish(1);
|
|
46
|
+
/* C1 the strip */
|
|
47
|
+
const A = await open('/premium-viewer.html?open=calendar');
|
|
97
48
|
const p = A.page;
|
|
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));
|
|
54
|
+
ok('C1 each day button is at least 44 px', strip.every((d) => d.h >= 44), JSON.stringify(strip));
|
|
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'))));
|
|
98
56
|
|
|
99
|
-
/*
|
|
100
|
-
await
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
ok('
|
|
105
|
-
ok('
|
|
106
|
-
|
|
107
|
-
ok('
|
|
57
|
+
/* C2 the day */
|
|
58
|
+
const today = await text(p);
|
|
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));
|
|
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));
|
|
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));
|
|
63
|
+
ok('C2 another day of the same week is not read again', weekReads(A.S) === 1);
|
|
64
|
+
await p.evaluate(() => [...document.querySelectorAll('#czViewer .vzc-dy')].find((d) => /today/.test(d.getAttribute('aria-label'))).click());
|
|
65
|
+
ok('C2 pressing today brings Today back unchanged', await until(async () => (await text(p)) === today));
|
|
108
66
|
|
|
109
|
-
/*
|
|
110
|
-
await
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
pressed: [...document.querySelectorAll('#wkStrip [aria-pressed="true"]')].map((b) => b.dataset.day), label: document.querySelector('#tl').getAttribute('aria-label') }));
|
|
115
|
-
ok('C2 pressing a day lists that day only, with its count', wk.days.length === 1 && /2 meetings/.test(wk.days[0]) && wk.pressed.join() === dayKey(OTHER()), JSON.stringify(wk));
|
|
116
|
-
ok('C2 a row shows time, title, length, people and what it is about', wk.rows.some((r) => r === 'Sprint planning|14:00|1 h · with Dara, Priya, Sam · Board: IDPF') && wk.rows.some((r) => r === 'Checkout sync|09:30|45 min · with Priya, Dara'), JSON.stringify(wk.rows));
|
|
117
|
-
ok('C2 the caption counts the day\'s meetings and the source filter is hidden', /^2 meetings/.test(wk.cap) && wk.filter === 'none', JSON.stringify(wk));
|
|
118
|
-
if (isWeekday) {
|
|
119
|
-
await p.click(`#wkStrip [data-day="${dayKey(NOW)}"]`);
|
|
120
|
-
const back = await p.evaluate(() => ({ ahead: !!document.querySelector('#tl .grp'), wk: !!document.querySelector('#tl .wkd'), filter: getComputedStyle(document.querySelector('#todayCard .fbtn')).display, cap: document.querySelector('#todayCap').textContent }));
|
|
121
|
-
ok('C2 pressing today brings Today back unchanged', back.ahead && !back.wk && back.filter !== 'none' && /earlier · \d+ ahead/.test(back.cap), JSON.stringify(back));
|
|
122
|
-
await week(p);
|
|
123
|
-
}
|
|
67
|
+
/* C4 a meeting */
|
|
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));
|
|
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)));
|
|
71
|
+
ok('C4 the card has no conversation and no tabs', await p.evaluate(() => !document.querySelector('#dlg, .stream, #vTabs')));
|
|
124
72
|
|
|
125
|
-
/*
|
|
126
|
-
await p
|
|
127
|
-
|
|
128
|
-
ok('
|
|
129
|
-
const H2p = await A.ctx.newPage(); await H2p.goto(BASE + '/premium.html?theme=light');
|
|
130
|
-
ok('C11 a reload keeps it hidden', await until(() => H2p.evaluate(() => document.querySelector('#todayCard').classList.contains('calhid'))));
|
|
131
|
-
await H2p.click('#todayCard .folds');
|
|
132
|
-
ok('C11 pressing the line shows it again, and that is kept', await until(() => H2p.evaluate(() => !document.querySelector('#todayCard').classList.contains('calhid') && localStorage.getItem('pmos.premium.calfold.brief') === '0')));
|
|
133
|
-
await H2p.close();
|
|
134
|
-
await p.click('#todayCard .foldb');
|
|
135
|
-
await until(() => p.evaluate(() => !document.querySelector('#todayCard').classList.contains('calhid')));
|
|
73
|
+
/* C6, C7, C8 the parts */
|
|
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"]')));
|
|
136
77
|
|
|
137
|
-
/*
|
|
138
|
-
await p
|
|
139
|
-
const
|
|
140
|
-
await p
|
|
141
|
-
|
|
142
|
-
ok('
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
ok('
|
|
147
|
-
ok('
|
|
148
|
-
ok('C5 the dialog says what it is about, and that the calendar is never written', dlg && /It is about Board: IDPF/.test(dlg.text) && /calendar itself is never written/.test(dlg.text));
|
|
149
|
-
await p.keyboard.press('Escape');
|
|
150
|
-
// re-pointed for premium-agreed-design H2: on a desktop Home the chat is docked and stays open, so Escape takes the meeting's
|
|
151
|
-
// conversation back to the PM's own chat (title "Chat", the docked #dlg stays on) instead of closing the dialog; focus still returns to the row
|
|
152
|
-
const closed = await until(() => p.evaluate(() => { const g = document.querySelector('#dlg'); return !g.classList.contains('on') || (document.body.classList.contains('cz-dock') && document.querySelector('#dTitle').textContent === 'Chat'); }));
|
|
153
|
-
ok('C4 Escape closes the meeting\'s dialog and focus returns to the row', closed && await until(() => p.evaluate(() => document.activeElement && document.activeElement.id === 'rowSprint'), 3000));
|
|
78
|
+
/* C5 link it: a calendar meeting is linked for its whole series */
|
|
79
|
+
await tap(p, '[data-a="m-about"]');
|
|
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));
|
|
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)));
|
|
83
|
+
ok('C5 opening the choices writes nothing', A.S.posts.length === 0);
|
|
84
|
+
const r0 = weekReads(A.S);
|
|
85
|
+
await tap(p, '[data-a="aboutpick"][data-v="board|w1|b1"]');
|
|
86
|
+
const link = await until(() => A.S.posts.find((x) => x.path === '/api/calendar-links'));
|
|
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));
|
|
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));
|
|
154
89
|
|
|
155
|
-
/*
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
await
|
|
159
|
-
const dis = await p.evaluate(() => document.querySelector('#mtgLink').disabled);
|
|
160
|
-
ok('C5 Link it is off until a choice is made', dis === true);
|
|
161
|
-
const optsText = await p.evaluate(() => [...document.querySelectorAll('#mtgSel option')].map((o) => o.textContent));
|
|
162
|
-
ok('C5 the choices are the Portfolio, the answer\'s boards and initiatives, and removing the link', optsText.includes('Portfolio') && optsText.includes('Board: Payments') && optsText.includes('Initiative: Premium UX') && optsText.includes('Remove the link'), JSON.stringify(optsText));
|
|
163
|
-
await p.selectOption('#mtgSel', 'board|w1|pay');
|
|
164
|
-
await p.click('#mtgLink');
|
|
165
|
-
await until(() => A.posts.length === 1);
|
|
166
|
-
ok('C5 the press posts one link to /api/calendar-links for the meeting and its series', A.posts.length === 1 && A.posts[0].kind === 'board' && A.posts[0].board === 'pay' && A.posts[0].ws === 'w1' && A.posts[0].event.title === 'Sprint planning' && A.posts[0].event.series === 'sprint-planning', JSON.stringify(A.posts));
|
|
167
|
-
ok('C5 after the write the week is read again', await until(() => A.weekGets.length >= 2));
|
|
168
|
-
await p.keyboard.press('Escape');
|
|
90
|
+
/* C9 only the link write */
|
|
91
|
+
ok('C9 the only write the page sent is the link', [...new Set(A.S.posts.map((x) => x.path))].join() === '/api/calendar-links', A.S.posts.map((x) => x.path).join());
|
|
92
|
+
ok('C9 no recording, Focus or material write was sent', !A.S.posts.some((x) => /notes|meeting-focus|meeting-material/.test(x.path)));
|
|
93
|
+
await A.ctx.close();
|
|
169
94
|
|
|
170
|
-
/*
|
|
171
|
-
const
|
|
172
|
-
await
|
|
173
|
-
|
|
174
|
-
ok('C3 a failed read says "Calendar not read" with the reason and draws no meeting', /Calendar not read\./.test(er.text) && /boom/.test(er.text) && er.rows === 0 && er.cap === 'Calendar not read', JSON.stringify(er));
|
|
175
|
-
const Z = await open({ week: Object.assign(weekAnswer(), { cells: weekAnswer().cells.map((c) => Object.assign({}, c, { events: [] })), context: {} }) });
|
|
176
|
-
await week(Z.page);
|
|
177
|
-
ok('C3 an empty day says so', await Z.page.evaluate(() => /^No meetings/.test(document.querySelector('#todayCap').textContent) && /No meetings\./.test(document.querySelector('#tl').textContent) && document.querySelectorAll('#tl .ev').length === 0));
|
|
178
|
-
|
|
179
|
-
/* C6 C8 with a note and a recording */
|
|
180
|
-
const R = await open({ replay: REPLAY });
|
|
181
|
-
await week(R.page);
|
|
182
|
-
await R.page.evaluate(() => { [...document.querySelectorAll('#tl .ev')].find((e) => e.querySelector('b').textContent === 'Sprint planning').click(); });
|
|
183
|
-
const rd = await until(() => R.page.evaluate(() => /Next step/.test(document.querySelector('#oMain').textContent) ? document.querySelector('#oMain').textContent : null));
|
|
184
|
-
const owner = await R.page.evaluate(() => { const c = document.querySelector('#oMain [data-vm-t="actions"] tbody tr'); return c ? [...c.children].slice(1, 3).map((x) => x.textContent).join(' · ') : ''; });
|
|
185
|
-
ok('C6 the note\'s decisions, next steps and questions are listed as the note holds them', rd && /Plan the sprint with eight people/.test(rd) && /Sam confirms the data fix owner/.test(rd) && /^Sam · Tue/.test(owner) && /Does a release eat the capacity\?/.test(rd) && /Sprint planning notes/.test(rd), String(rd).slice(0, 300));
|
|
186
|
-
ok('C8 a kept recording is summarised, and Replay opens in the dialog', rd && /A recording is kept: 25 min, 3 key points/.test(rd) && /Replay/.test(rd) && !/Replay opens in the console/.test(rd));
|
|
187
|
-
const ppl = await R.page.evaluate(() => [...document.querySelectorAll('#oMain .vm-ppl .pp')].map((x) => x.lastChild.textContent).join(', '));
|
|
188
|
-
ok('C6 the replay answer\'s people are used only when the calendar lists none', rd && ppl === 'Dara, Priya, Sam', ppl);
|
|
95
|
+
/* C8 a kept recording offers Replay */
|
|
96
|
+
const R = await open('/premium-viewer.html?open=meeting¬e=n1');
|
|
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)));
|
|
98
|
+
await R.ctx.close();
|
|
189
99
|
|
|
190
|
-
/*
|
|
191
|
-
const
|
|
192
|
-
await
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
await
|
|
197
|
-
|
|
100
|
+
/* C3 honest states */
|
|
101
|
+
const E = await open('/premium-viewer.html?open=calendar');
|
|
102
|
+
await E.page.route('**/api/calendar-views*', (r) => { const w = W.week(); w.cells.forEach((c) => { c.events = []; }); return json(r, w); });
|
|
103
|
+
await E.page.route(/\/api\/notes(\?.*)?$/, (r) => json(r, { ok: true, notes: [], series_open: {} }));
|
|
104
|
+
await E.page.reload();
|
|
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));
|
|
106
|
+
await E.page.route('**/api/calendar-views*', (r) => json(r, { ok: false, error: 'the calendar is not connected' }, 500));
|
|
107
|
+
await E.page.reload();
|
|
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));
|
|
109
|
+
await E.ctx.close();
|
|
198
110
|
|
|
199
|
-
/*
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
ok('
|
|
204
|
-
|
|
111
|
+
/* C4 Escape closes the card */
|
|
112
|
+
const G = await open('/premium-viewer.html?open=meeting&event=ev-rail&date=' + F.dayKey(W.RAIL));
|
|
113
|
+
await until(() => G.page.evaluate(() => !!document.querySelector('#czViewer .vz-mtg')), 15000);
|
|
114
|
+
await G.page.keyboard.press('Escape');
|
|
115
|
+
ok('C4 Escape closes the meeting card', await until(() => G.page.evaluate(() => { const v = document.querySelector('#czViewer'); return !v || v.hidden || !v.querySelector('.vz-mtg'); })));
|
|
116
|
+
await G.ctx.close();
|
|
205
117
|
|
|
206
|
-
/* C10 floors
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
const f = await P.page.evaluate(() => ({ scroll: document.documentElement.scrollWidth <= innerWidth + 1, rows: [...document.querySelectorAll('#tl .ev')].map((e) => e.getBoundingClientRect().height), sw: [...document.querySelectorAll('#wkStrip [data-day], #todayCard .foldb')].map((b) => Math.min(b.getBoundingClientRect().width, b.getBoundingClientRect().height)) }));
|
|
214
|
-
ok(`C10 at 390 px (${th}) there is no sideways scroll and rows, day buttons and the chevron are at least 44 px`, f.scroll && f.rows.every((h) => h >= 44) && f.sw.every((n) => n >= 44), JSON.stringify(f));
|
|
215
|
-
await P.ctx.close();
|
|
216
|
-
}
|
|
217
|
-
const css = (page, sel) => page.evaluate((s) => { const e = document.querySelector(s); if (!e) return null; const c = getComputedStyle(e); return ['fontSize', 'fontWeight', 'letterSpacing', 'textTransform', 'borderRadius', 'paddingTop', 'color'].map((k) => c[k]).join('|'); }, sel);
|
|
218
|
-
const mk = await browser.newContext({ viewport: { width: 1280, height: 900 } }); const mp = await mk.newPage();
|
|
219
|
-
await mp.setContent(MOCKUP); await CT.applyToPage(mp, CT_VENDOR); await mp.waitForTimeout(500);
|
|
220
|
-
const F1 = await open();
|
|
221
|
-
/* re-pointed for premium-agreed-design: the Agreed design replaces the old Briefing mockup's look (its 28 px card, its ink and amber now-line).
|
|
222
|
-
* On Home the Calendar is a group of the list: no card box (cozy-home.css .cz-home .card), the cozy ink for text and the cozy blue ink for
|
|
223
|
-
* the now line, read from cozy.css's tokens in the page. The type (size, weight, tracking, case) is still the mockup's. */
|
|
224
|
-
const tok = (page, v) => page.evaluate((v) => { const e = document.createElement('i'); e.style.color = 'var(' + v + ')'; document.body.appendChild(e); const c = getComputedStyle(e).color; e.remove(); return c; }, v);
|
|
225
|
-
const ink = await tok(F1.page, '--cz-ink'), blueink = await tok(F1.page, '--cz-blueink');
|
|
226
|
-
const agreed = { '#todayCard': { box: '0px|0px', color: ink }, '#tl .ev b': { box: '0px|0px', color: ink }, '#tl .nowl': { box: '0px|8px', color: blueink } };
|
|
227
|
-
for (const a of Object.keys(agreed)) {
|
|
228
|
-
const x = await css(mp, a), y = await css(F1.page, a), xs = (x || '').split('|'), ys = (y || '').split('|');
|
|
229
|
-
ok('C10 fidelity: ' + a + ' keeps the mockup\'s type and takes the Agreed design\'s box and colour at 1280 px', !!x && !!y && /^rgb/.test(ink) && xs.slice(0, 4).join('|') === ys.slice(0, 4).join('|') && ys.slice(4, 6).join('|') === agreed[a].box && ys[6] === agreed[a].color, x + ' vs ' + y + ' (agreed ' + JSON.stringify(agreed[a]) + ')');
|
|
230
|
-
}
|
|
231
|
-
const grp = await css(mp, '#tl .grp');
|
|
232
|
-
await week(F1.page);
|
|
233
|
-
const wd = await css(F1.page, "#tl .wkd");
|
|
234
|
-
ok('C10 fidelity: a day heading uses the mockup\'s group-heading type', grp && wd && wd.split('|').slice(0, 4).join('|') === grp.split('|').slice(0, 4).join('|'), grp + ' vs ' + wd);
|
|
235
|
-
await mk.close();
|
|
118
|
+
/* C10 floors */
|
|
119
|
+
const H = await open('/premium-viewer.html?open=meeting&event=ev-rail&date=' + F.dayKey(W.RAIL), { w: 390, h: 844 });
|
|
120
|
+
await until(() => H.page.evaluate(() => !!document.querySelector('#czViewer .vz-mtg')), 15000);
|
|
121
|
+
const fl = await H.page.evaluate(() => ({ over: document.documentElement.scrollWidth - innerWidth }));
|
|
122
|
+
ok('C10 at 390 px the meeting card has no sideways scroll', fl.over <= 0, JSON.stringify(fl));
|
|
123
|
+
await H.ctx.close();
|
|
124
|
+
ok('C9 no page error', ALL.every((x) => x.errors.length === 0), JSON.stringify(ALL.map((x) => x.errors).filter((e) => e.length)));
|
|
236
125
|
return finish();
|
|
237
126
|
})().catch((e) => { console.error(e); finish(1); });
|