create-pmos 0.396.0 → 0.398.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/scripts/nine-stages.js +49 -20
- package/payload/state/discoveries.md +1 -1
- package/payload/state/log.md +1 -1
- package/workspace/briefing-premium-adddoc-test.js +103 -74
- package/workspace/briefing-premium-board-test.js +316 -154
- package/workspace/briefing-premium-calendar-2-test.js +135 -195
- package/workspace/briefing-premium-calendar-3-test.js +143 -413
- package/workspace/briefing-premium-calendar-test.js +86 -185
- package/workspace/briefing-premium-doc-edit-test.js +95 -83
- package/workspace/briefing-premium-initiative-test.js +166 -294
- package/workspace/briefing-premium-insights-test.js +351 -214
- package/workspace/briefing-premium-metrics-test.js +53 -118
- package/workspace/briefing-premium-products-test.js +40 -27
- package/workspace/briefing-premium-sources-test.js +91 -52
- package/workspace/briefing-premium-test.js +150 -633
- package/workspace/briefing-premium-work-test.js +88 -269
- package/workspace/changelog.json +24 -0
- package/workspace/fixtures/board-premium-facts.js +2 -1
- package/workspace/fixtures/board-premium-jira.js +28 -0
- package/workspace/fixtures/board-premium-trail.js +32 -0
- package/workspace/fixtures/initiative-premium-facts.js +2 -1
- package/workspace/fixtures/initiatives-api/list.json +30 -42
- package/workspace/fixtures/initiatives-api/roadmap.json +40 -56
- package/workspace/fixtures/initiatives-api/sheet.json +10 -14
- package/workspace/fixtures/insights-premium-facts.js +11 -2
- package/workspace/fixtures/premium-viewer-fixtures.js +182 -0
- package/workspace/guide/briefing-premium.md +3 -1
- package/workspace/guide/home.md +47 -0
- package/workspace/guide/index.md +2 -0
- package/workspace/guide/lifecycle.md +51 -0
- package/workspace/home-shot.js +38 -0
- package/workspace/lib/agent-roles.js +71 -0
- package/workspace/lib/board-premium.js +160 -3
- package/workspace/lib/board-trail.js +223 -0
- package/workspace/lib/engine/boards.js +15 -14
- package/workspace/lib/engine/nine-stages.js +49 -20
- package/workspace/lib/engine/signals/detectors.js +13 -11
- package/workspace/lib/home-work-item.js +58 -0
- package/workspace/lib/insights-goals.js +196 -0
- package/workspace/lib/insights-premium.js +126 -1
- package/workspace/lib/insights-records.js +101 -0
- package/workspace/lib/jira-tickets.js +1 -1
- package/workspace/lib/route-modules.js +4 -0
- package/workspace/lib/routes-board-premium.js +3 -2
- package/workspace/lib/routes-board-trail.js +33 -0
- package/workspace/lib/routes-home-desk.js +176 -0
- package/workspace/lib/routes-initiatives.js +1 -1
- package/workspace/lib/routes-insights-premium.js +19 -3
- package/workspace/lib/routes-insights-records.js +129 -0
- package/workspace/lib/routes-notes.js +1 -0
- package/workspace/lib/routes-viewer.js +108 -0
- package/workspace/lib/transcript-steps.js +123 -0
- package/workspace/lib/vendor/scripts/nine-stages.js +49 -20
- 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-agreed-viewer-shots.js +76 -0
- package/workspace/premium-board-actions-test.js +85 -73
- package/workspace/premium-briefing-depth-test.js +66 -53
- package/workspace/premium-chat-attach-test.js +54 -63
- package/workspace/premium-chat-chart-tab-test.js +35 -36
- package/workspace/premium-chat-context-test.js +22 -19
- package/workspace/premium-chat-goal-view-test.js +28 -26
- package/workspace/premium-chat-notes-test.js +29 -33
- package/workspace/premium-chat-report-tab-test.js +35 -25
- package/workspace/premium-chat-term-test.js +16 -14
- package/workspace/premium-chat-viewer-test.js +60 -53
- package/workspace/premium-core-doc-issue-test.js +50 -41
- package/workspace/premium-html-viewer-test.js +17 -18
- package/workspace/premium-phone-card-test.js +8 -2
- package/workspace/premium-phone-room-test.js +42 -31
- package/workspace/premium-report-read-test.js +115 -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 -31
- package/workspace/premium-vw-cal-test.js +82 -123
- package/workspace/premium-vw-copy-test.js +17 -33
- package/workspace/premium-vw-doc-test.js +12 -11
- package/workspace/premium-vw-item-test.js +50 -48
- package/workspace/premium-vw-jira-test.js +55 -26
- package/workspace/premium-vw-meet-test.js +118 -187
- package/workspace/premium-vw-notes-test.js +85 -107
- package/workspace/premium-vw-rec-test.js +72 -193
- package/workspace/premium-vw-slides-test.js +46 -50
- package/workspace/premium-welcome-test.js +3 -2
- package/workspace/premium-work-depth-test.js +63 -51
- package/workspace/public/pm/bd-acts.js +305 -0
- package/workspace/public/pm/bd-span.js +224 -0
- package/workspace/public/pm/bd-stages.js +47 -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 +640 -0
- package/workspace/public/pm/cozy-home.css +580 -0
- package/workspace/public/pm/cozy-home.js +172 -0
- package/workspace/public/pm/cozy-initiative.css +138 -0
- package/workspace/public/pm/cozy-insights.css +421 -0
- package/workspace/public/pm/cozy-md.js +396 -0
- package/workspace/public/pm/cozy-nav.js +65 -0
- package/workspace/public/pm/cozy-placeholder.js +26 -0
- package/workspace/public/pm/cozy-viewer.css +143 -0
- package/workspace/public/pm/cozy-viewer.js +144 -0
- package/workspace/public/pm/cozy-vw.css +485 -0
- package/workspace/public/pm/cozy.css +254 -0
- package/workspace/public/pm/home-adddoc.js +48 -0
- package/workspace/public/pm/home-app.js +905 -0
- package/workspace/public/pm/home-around.js +515 -0
- package/workspace/public/pm/home-chat.js +459 -0
- package/workspace/public/pm/home-data.js +312 -0
- package/workspace/public/pm/home-draft.js +68 -0
- package/workspace/public/pm/home-more.js +249 -0
- package/workspace/public/pm/home-phone-card.js +109 -0
- package/workspace/public/pm/home-work.js +519 -0
- package/workspace/public/pm/lifecycle-lens-model.js +45 -27
- package/workspace/public/pm/lifecycle-lens.js +22 -11
- 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 +544 -253
- package/workspace/public/pm/premium-brief.js +1 -1
- package/workspace/public/pm/premium-chart-tab.js +110 -62
- package/workspace/public/pm/premium-chat.js +17 -10
- package/workspace/public/pm/premium-deck.js +3 -3
- package/workspace/public/pm/premium-first.js +25 -21
- package/workspace/public/pm/premium-initiative-head.js +138 -0
- package/workspace/public/pm/premium-initiative.js +28 -4
- package/workspace/public/pm/premium-insights.js +950 -440
- package/workspace/public/pm/premium-meeting.js +61 -549
- 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 +509 -480
- package/workspace/public/pm/premium-report-tab.js +87 -63
- package/workspace/public/pm/premium-shell.js +107 -124
- package/workspace/public/pm/premium-viewer.js +27 -1
- package/workspace/public/pm/premium-vw-cal.js +187 -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-jira-model.js +22 -5
- package/workspace/public/pm/premium-vw-jira.css +11 -0
- package/workspace/public/pm/premium-vw-jira.js +11 -4
- package/workspace/public/pm/premium-vw-meet.js +6 -83
- package/workspace/public/pm/premium-vw-mtg.js +731 -0
- package/workspace/public/pm/premium-vw-notes.js +56 -69
- 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 -215
- package/workspace/public/pm/premium-vw-slides.css +5 -0
- package/workspace/public/pm/premium-vw-slides.js +44 -8
- package/workspace/public/pm/term-view.js +22 -0
- package/workspace/public/premium-board.html +57 -64
- package/workspace/public/premium-chat.html +7 -33
- package/workspace/public/premium-initiative.html +8 -41
- package/workspace/public/premium-insights.html +63 -62
- package/workspace/public/premium-viewer.html +20 -0
- package/workspace/public/premium-work.html +6 -72
- package/workspace/public/premium.html +21 -66
- package/workspace/public/vendor/nunito-var.woff2 +0 -0
- package/workspace/server.js +25 -3
- package/workspace/test-files.json +1 -0
- package/workspace/test-lists/home-libs.json +9 -0
- package/workspace/test-lists/premium-agreed-viewer.json +9 -0
- package/workspace/test-lists/premium-report-read.json +1 -1
- package/workspace/test-lists/premium-vw-agreed.json +9 -0
- package/workspace/test-lists/premium-vw-notes.json +1 -1
- package/workspace/third-party/README.md +1 -0
- package/workspace/public/pm/premium-work.js +0 -719
- package/workspace/public/pm/premium.js +0 -1133
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
|
-
/* premium-vw-notes-test.js — the Notes list and a note opened
|
|
4
|
-
*
|
|
5
|
-
* so each press can be read off the request the page sent.
|
|
6
|
-
*
|
|
3
|
+
/* premium-vw-notes-test.js — the Notes list and a note opened from it (initiative premium-viewer, R9; re-pointed for premium-agreed-design, area
|
|
4
|
+
* viewer: Main.dc.html viewer prop cal, the Notes side). Serves the real /premium-viewer.html from the real server; the notes, the boards, the
|
|
5
|
+
* search and the note are answered by stand-ins (fixtures/premium-viewer-fixtures.js), so each press can be read off the request the page sent.
|
|
6
|
+
* The routes' own behaviour is in their own suites; the pure half (notesGroups) is in premium-vw-agreed.test.js.
|
|
7
|
+
* N1 open · N2 groups · N3 series · N4 search · N5 a note opens in the card · N6 Change what it is about · N7 writes · N8 floors
|
|
7
8
|
* Every wait polls the page; no fixed sleep stands in for a state. */
|
|
8
9
|
const path = require('path');
|
|
9
10
|
const { spawn } = require('child_process');
|
|
10
11
|
const { findBrowser } = require('./lib/find-browser');
|
|
11
12
|
const T = require('./test-run').configure({ name: 'premium-vw-notes' });
|
|
12
|
-
const
|
|
13
|
-
const F = require('./fixtures/briefing-premium-facts.js');
|
|
13
|
+
const F = require('./fixtures/premium-viewer-fixtures.js');
|
|
14
14
|
|
|
15
|
-
const BASE = T.BASE;
|
|
16
|
-
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
17
|
-
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); } };
|
|
15
|
+
const BASE = T.BASE, until = F.until;
|
|
18
16
|
const results = [];
|
|
19
|
-
const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + extra : ''}`); };
|
|
17
|
+
const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + String(extra).slice(0, 500) : ''}`); };
|
|
20
18
|
let srv = null; let browser = null;
|
|
21
19
|
const finish = async (code) => {
|
|
22
20
|
if (browser) await browser.close().catch(() => {});
|
|
@@ -28,15 +26,6 @@ const finish = async (code) => {
|
|
|
28
26
|
};
|
|
29
27
|
process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
30
28
|
|
|
31
|
-
const NOW = new Date();
|
|
32
|
-
const ROWS = [
|
|
33
|
-
{ id: 'n1', title: 'Weekly sync', state: 'ended', updated_at: NOW.toISOString(), meeting: { kind: 'event', title: 'Weekly sync', start: '2026-10-19T10:00:00+07:00' }, board: { id: 'b1', ws: 'w1', title: 'Growth' }, initiative: { id: 'ux', ws: 'w1', title: 'Premium UX' }, series: { key: 'wk', by: 'calendar' }, meeting_ms: 32 * 60000, summary_lines: ['The copy test was agreed.'] },
|
|
34
|
-
{ id: 'n0', title: 'Weekly sync', state: 'ended', updated_at: NOW.toISOString(), meeting: { kind: 'event', title: 'Weekly sync', start: '2026-10-12T10:00:00+07:00' }, board: { id: 'b1', ws: 'w1', title: 'Growth' }, series: { key: 'wk', by: 'calendar' }, summary_lines: ['The runbook was asked for.'] },
|
|
35
|
-
{ id: 'n2', title: 'Exec sync', state: 'ended', updated_at: NOW.toISOString(), meeting: { kind: 'event', title: 'Exec sync', start: '2026-10-16T10:00:00+07:00' }, portfolio: true, meeting_ms: 28 * 60000 },
|
|
36
|
-
{ id: 'n3', title: 'Call with a partner', state: 'ended', updated_at: NOW.toISOString(), created_at: '2026-10-15T08:00:00Z', meeting: null, summary_lines: ['They want SSO before they move 40 seats.'] },
|
|
37
|
-
];
|
|
38
|
-
const NOTE = { id: 'n3', title: 'Call with a partner', state: 'ended', meeting: null, meeting_ms: 22 * 60000, final_notes: { overview: 'The partner wants SSO first.', decisions: [{ text: 'Price SSO in the team plan', why: 'Two partners asked.' }], actions: [{ text: 'Send the SSO plan', owner: 'Ana', due: '2026-10-24' }], questions: [] } };
|
|
39
|
-
|
|
40
29
|
(async () => {
|
|
41
30
|
const exe = findBrowser();
|
|
42
31
|
if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the suite cannot run'); return finish(1); }
|
|
@@ -45,117 +34,106 @@ const NOTE = { id: 'n3', title: 'Call with a partner', state: 'ended', meeting:
|
|
|
45
34
|
srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
|
|
46
35
|
await T.waitForServer(BASE);
|
|
47
36
|
browser = await chromium.launch({ executablePath: exe });
|
|
48
|
-
|
|
49
|
-
const
|
|
50
|
-
const
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
await page.route('**/api/
|
|
58
|
-
|
|
59
|
-
await page.route('**/api/notes/search*', (r) => { const q = new URL(r.request().url()).searchParams.get('q'); S.searches.push(q); return json(r, { ok: true, ids: /runbook|said/.test(q) ? ['n0'] : [] }); });
|
|
60
|
-
await page.route('**/api/notes/one*', (r) => { const id = new URL(r.request().url()).searchParams.get('id'); S.oneGets.push(id);
|
|
61
|
-
const n = id === 'n3' ? S.note : { ...ROWS.find((x) => x.id === id), final_notes: { overview: 'Notes of ' + id, decisions: [], actions: [], questions: [] } };
|
|
62
|
-
return json(r, { ok: true, note: n, place: id === 'n3' ? null : { key: 'wk', title: 'Weekly sync', pos: id === 'n1' ? 2 : 1, count: 2, prev: id === 'n1' ? { id: 'n0', at: '2026-10-12T03:00:00Z' } : null, next: id === 'n0' ? { id: 'n1', at: '2026-10-19T03:00:00Z' } : null } }); });
|
|
63
|
-
await page.route('**/api/notes/link', (r) => { const b = JSON.parse(r.request().postData() || '{}'); S.linkPosts.push(b); if (b.initiative) S.note = { ...S.note, board: b.board, initiative: b.initiative }; return json(r, { ok: true }); });
|
|
64
|
-
await page.route(/\/api\/notes(\?.*)?$/, (r) => json(r, { ok: true, notes, series_open: { wk: { open: 2, carried: false } } }));
|
|
65
|
-
await page.route(/\/api\/boards(\?.*)?$/, (r) => json(r, { ok: true, boards: [{ id: 'b1', ws: 'w1', name: 'Growth' }] }));
|
|
66
|
-
await page.route('**/api/boards/backlog*', (r) => json(r, { ok: true, rows: [{ id: 'ux', title: 'Premium UX' }, { id: 'sso', title: 'SSO for teams' }] }));
|
|
67
|
-
await page.goto(BASE + '/premium.html?theme=' + theme);
|
|
68
|
-
S.up = await until(() => page.evaluate(() => !!document.querySelector('#vnOpen') && !!document.querySelector('#vnOpenFoot') && document.querySelectorAll('#rank .rr').length > 0), 20000);
|
|
69
|
-
if (S.up) { if (w <= 600 && await page.evaluate(() => document.querySelector('#todayCard').classList.contains('calhid'))) await page.click('#todayCard .foldb'); if (w > 600) await page.click('#calMore'); await page.click(w <= 600 ? '#vnOpenFoot' : '#vnOpen'); S.dlg = await until(() => page.evaluate(() => document.querySelector('#dlg').classList.contains('on') && document.querySelectorAll('#vnBody .vn-g').length > 0)); }
|
|
70
|
-
SESS.push(S);
|
|
71
|
-
return Object.assign(S, { ctx, page });
|
|
37
|
+
const tap = (p, sel) => p.$eval('#czViewer ' + sel, (b) => b.click());
|
|
38
|
+
const text = (p) => p.evaluate(() => (document.querySelector('#czViewer') || {}).innerText || '');
|
|
39
|
+
const groups = (p) => p.evaluate(() => [...document.querySelectorAll('#czViewer .vz-grp h3')].map((h) => h.firstChild.textContent.trim() + ':' + h.querySelector('small').textContent));
|
|
40
|
+
const ids = (p) => p.evaluate(() => [...document.querySelectorAll('#czViewer [data-c="note"]')].map((b) => b.dataset.id));
|
|
41
|
+
const ALL = [];
|
|
42
|
+
const open = async (url, o = {}) => {
|
|
43
|
+
const X = await F.open(browser, BASE, url, { noLive: true, ...o });
|
|
44
|
+
ALL.push(X);
|
|
45
|
+
/* search what was said: the server finds n0 for "said", nothing else */
|
|
46
|
+
await X.page.route('**/api/notes/search*', (r) => { const q = new URL(r.request().url()).searchParams.get('q'); X.S.searches = (X.S.searches || []).concat(q); return r.fulfill({ status: 200, contentType: 'application/json', body: JSON.stringify({ ok: true, ids: /said/.test(q) ? ['n0'] : [] }) }); });
|
|
47
|
+
return X;
|
|
72
48
|
};
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
49
|
+
|
|
50
|
+
/* N1 open */
|
|
51
|
+
const A = await open('/premium-viewer.html?open=notes');
|
|
76
52
|
const p = A.page;
|
|
53
|
+
ok('N1 ?open=notes opens the Viewer card on its Notes side', await until(() => p.evaluate(() => document.querySelectorAll('#czViewer .vz-grp').length > 0 && document.querySelector('#czViewer .vz-seg [data-c="tab"][data-k="notes"]').getAttribute('aria-selected') === 'true'), 15000), (await text(p)).slice(0, 300));
|
|
54
|
+
ok('N1 the card has Calendar | Notes, New note and the search, and no tabs strip or conversation', await p.evaluate(() => !!document.querySelector('#czViewer [data-c="new"]') && !!document.querySelector('#czViewer [data-c="q"]') && !document.querySelector('#vTabs, #dlg, .stream')));
|
|
77
55
|
|
|
78
56
|
/* N2 groups */
|
|
79
|
-
const g = await
|
|
80
|
-
ok('N2
|
|
81
|
-
const r3 = await p.evaluate(() => document.querySelector('[data-
|
|
82
|
-
ok('N2 a note
|
|
57
|
+
const g = await groups(p);
|
|
58
|
+
ok('N2 grouped by initiative, newest first, Not linked last, each with its count', g.join('|') === 'Viewer:2 notes|Saved views for teams:1 note|Not linked:1 note', JSON.stringify(g));
|
|
59
|
+
const r3 = await p.evaluate(() => { const b = document.querySelector('#czViewer [data-c="note"][data-id="n3"]'); return b ? b.textContent : ''; });
|
|
60
|
+
ok('N2 a note that is not linked shows Link it and its length', /Link it/.test(r3) && /20 min/.test(r3), r3);
|
|
83
61
|
|
|
84
62
|
/* N3 series */
|
|
85
|
-
const ser = await p.evaluate(() => document.querySelector('[data-
|
|
86
|
-
ok('N3 the two notes of the series are one
|
|
87
|
-
await p.click('[data-vn-fold="wk"]');
|
|
88
|
-
ok('N3 folding the series open lists its notes with their first summary line', await until(() => p.evaluate(() => !!document.querySelector('.vn-sub [data-vn-note="n0"]') && /The runbook was asked for\./.test(document.querySelector('#vnBody').textContent) && document.querySelector('[data-vn-fold="wk"]').getAttribute('aria-expanded') === 'true')));
|
|
63
|
+
const ser = await p.evaluate(() => { const b = document.querySelector('#czViewer [data-series="viewer-sync"]'); return b ? b.textContent : ''; });
|
|
64
|
+
ok('N3 the two notes of the series are one row: Series · 2 meetings, with its open steps', /Series · 2 meetings/.test(ser) && /2 steps open/.test(ser) && (await ids(p)).filter((x) => x === 'n0').length === 0, ser);
|
|
89
65
|
|
|
90
66
|
/* N4 search */
|
|
91
|
-
await p.fill('#
|
|
92
|
-
ok('N4 typing filters the list at once
|
|
93
|
-
await p.
|
|
94
|
-
|
|
95
|
-
await p.
|
|
96
|
-
|
|
97
|
-
ok('N4
|
|
98
|
-
await p.fill('#
|
|
67
|
+
await p.fill('#czViewer [data-c="q"]', 'compare');
|
|
68
|
+
ok('N4 typing filters the list at once', await until(async () => (await ids(p)).join() === 'n3'), JSON.stringify(await ids(p)));
|
|
69
|
+
ok('N4 the search field keeps focus while typing', await p.evaluate(() => document.activeElement && document.activeElement.dataset.c === 'q'));
|
|
70
|
+
await p.fill('#czViewer [data-c="q"]', 'what was said');
|
|
71
|
+
ok('N4 a note found by the server search in what was said is listed', await until(async () => (await ids(p)).length === 1) && (A.S.searches || []).includes('what was said'), JSON.stringify(A.S.searches));
|
|
72
|
+
await p.fill('#czViewer [data-c="q"]', 'zzz');
|
|
73
|
+
ok('N4 no match says so', await until(async () => /No note matches “zzz”/.test(await text(p))));
|
|
74
|
+
await p.fill('#czViewer [data-c="q"]', '');
|
|
75
|
+
await until(async () => (await ids(p)).length === 3);
|
|
99
76
|
|
|
100
|
-
/* N5
|
|
101
|
-
await
|
|
102
|
-
await p.
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
await p
|
|
107
|
-
ok('N5
|
|
108
|
-
await p.
|
|
109
|
-
await p.
|
|
110
|
-
ok('N5 pressing a series opens its newest note, which says N of M', await until(() => p.evaluate(() => /Weekly sync · 2 of 2/.test((document.querySelector('#dOut .obody.vw[data-vw="meet-note"] .vm-ser') || {}).textContent || ''))) && A.oneGets.includes('n1'));
|
|
111
|
-
await p.click('#dOut .obody.vw[data-vw="meet-note"] [data-vm="prev"]');
|
|
112
|
-
ok('N5 paging reads the meeting before into the same tab', await until(() => A.oneGets.includes('n0')) && await p.evaluate(() => document.querySelectorAll('#vTabs .vtab').length === 2));
|
|
77
|
+
/* N5 a note opens in the card */
|
|
78
|
+
await tap(p, '[data-c="note"][data-id="n3"]');
|
|
79
|
+
ok('N5 a note opens as the meeting card in place of the list', await until(() => p.evaluate(() => !!document.querySelector('#czViewer .vz-mtg') && /Compare meeting note apps/.test(document.querySelector('#czViewer .cz-vw-title').textContent))), (await text(p)).slice(0, 300));
|
|
80
|
+
ok('N5 its head says Not linked, with Link it', await until(async () => /Not linked/.test(await text(p)) && !!(await p.$('#czViewer [data-a="m-about"]'))));
|
|
81
|
+
await p.evaluate(() => window.czViews.openNotes({}));
|
|
82
|
+
await until(() => p.evaluate(() => !!document.querySelector('#czViewer [data-series="viewer-sync"]')));
|
|
83
|
+
await tap(p, '[data-series="viewer-sync"]');
|
|
84
|
+
ok('N5 pressing a series opens its newest note, which says N of M', await until(async () => /Viewer sync · 4 of 4/.test(await text(p))) && A.S.gets.some((x) => /notes\/one\?id=n1/.test(x)), (await text(p)).slice(0, 300));
|
|
85
|
+
await tap(p, '.vz-ser [data-a="note"]');
|
|
86
|
+
ok('N5 paging reads the meeting before into the same card', await until(() => A.S.gets.some((x) => /notes\/one\?id=n0/.test(x))) && await p.evaluate(() => document.querySelectorAll('#czViewer .vz-mtg').length === 1));
|
|
113
87
|
|
|
114
88
|
/* N6 Change what it is about */
|
|
115
|
-
await p.
|
|
116
|
-
await p.
|
|
117
|
-
await
|
|
118
|
-
await p.
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
await p
|
|
122
|
-
await p.
|
|
123
|
-
await
|
|
124
|
-
|
|
125
|
-
|
|
89
|
+
await p.evaluate(() => window.czViews.openNotes({}));
|
|
90
|
+
await until(() => p.evaluate(() => !!document.querySelector('#czViewer [data-c="note"][data-id="n3"]')));
|
|
91
|
+
await tap(p, '[data-c="note"][data-id="n3"]');
|
|
92
|
+
await until(() => p.evaluate(() => !!document.querySelector('#czViewer [data-a="m-about"]')));
|
|
93
|
+
await tap(p, '[data-a="m-about"]');
|
|
94
|
+
const opts = await until(() => p.evaluate(() => { const s = document.querySelector('#czViewer [data-a="aboutsel"]'); return s ? [...s.options].map((o) => o.textContent) : null; }));
|
|
95
|
+
ok('N6 What it is about lists Portfolio, the board and its initiatives, marked Waiting for design', opts && opts.join('|') === 'Choose|Portfolio|Board: Growth|Initiative: Viewer|Not linked' && !!(await p.$('#czViewer [data-cz-placeholder="About picker"]')), JSON.stringify(opts));
|
|
96
|
+
await p.selectOption('#czViewer [data-a="aboutsel"]', 'i:w1/viewer');
|
|
97
|
+
await tap(p, '[data-a="aboutgo"]');
|
|
98
|
+
const links = () => A.S.posts.filter((x) => x.path === '/api/notes/link');
|
|
99
|
+
await until(() => links().length === 1);
|
|
100
|
+
ok('N6 Link it posts the console\'s link body for the note', JSON.stringify(links()[0] && links()[0].body) === JSON.stringify({ id: 'n3', board: { id: 'b1', ws: 'w1', title: 'Growth' }, initiative: { id: 'viewer', ws: 'w1', title: 'Viewer' } }), JSON.stringify(links()));
|
|
101
|
+
ok('N6 the note is read again and its head names the initiative', await until(async () => /About\s+Growth › Viewer/.test(await text(p)) && !(await p.$('#czViewer [data-a="aboutsel"]'))), (await text(p)).slice(0, 300));
|
|
126
102
|
|
|
127
103
|
/* N7 writes */
|
|
128
|
-
const posts = [...new Set(A.
|
|
129
|
-
ok('N7 the only write is the note\'s link', posts.join() === '
|
|
104
|
+
const posts = [...new Set(A.S.posts.map((x) => x.path))].sort();
|
|
105
|
+
ok('N7 the only write is the note\'s link', posts.join() === '/api/notes/link', posts.join());
|
|
130
106
|
const res = await fetch(BASE + '/api/notes/link', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ id: 'n-nothing', portfolio: true }) });
|
|
131
107
|
ok('N7 /api/notes/link without the launch nonce is refused', res.status === 403, String(res.status));
|
|
132
108
|
await A.ctx.close();
|
|
133
109
|
|
|
134
|
-
/*
|
|
135
|
-
const
|
|
136
|
-
ok('
|
|
110
|
+
/* N1 one initiative's notes */
|
|
111
|
+
const I = await open('/premium-viewer.html?open=notes&initiative=saved-views');
|
|
112
|
+
ok('N1 ?initiative= shows that initiative\'s notes only', await until(async () => (await groups(I.page)).join('|') === 'Saved views for teams:1 note'), JSON.stringify(await groups(I.page)));
|
|
113
|
+
await I.ctx.close();
|
|
114
|
+
|
|
115
|
+
/* N2 an empty store says so */
|
|
116
|
+
const Z = await open('/premium-viewer.html?open=notes');
|
|
117
|
+
await Z.page.route(/\/api\/notes(\?.*)?$/, (r) => r.fulfill({ status: 200, contentType: 'application/json', body: JSON.stringify({ ok: true, notes: [], series_open: {} }) }));
|
|
118
|
+
await Z.page.reload();
|
|
119
|
+
ok('N2 with no notes the list says notes you record show here', await until(async () => /No notes yet/.test(await text(Z.page))), (await text(Z.page)).slice(0, 300));
|
|
137
120
|
await Z.ctx.close();
|
|
138
121
|
|
|
139
122
|
/* N8 floors (PMOS_SHOTS=<dir> also saves pictures) */
|
|
140
123
|
const shotDir = process.env.PMOS_SHOTS || '';
|
|
141
|
-
for (const
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
await P.page.click('[data-vn-fold="wk"]');
|
|
146
|
-
const fl = () => P.page.evaluate(() => { const pane = [...document.querySelectorAll('#oMain, #dOut .obody.vw')].find((x) => !x.hidden) || document.querySelector('#oMain');
|
|
147
|
-
return { scroll: document.documentElement.scrollWidth <= innerWidth + 1 && pane.scrollWidth <= pane.clientWidth + 1,
|
|
148
|
-
btn: [...pane.querySelectorAll('.vn-o, .vn-x, .vn-q, .vm-sh, .vm-lk')].filter((b) => b.getClientRects().length).map((b) => Math.round(Math.min(b.getBoundingClientRect().width, b.getBoundingClientRect().height))) }; });
|
|
124
|
+
for (const th of ['light', 'dark']) {
|
|
125
|
+
const P = await open('/premium-viewer.html?open=notes&theme=' + th, { w: 390, h: 844 });
|
|
126
|
+
await until(() => P.page.evaluate(() => document.querySelectorAll('#czViewer .vz-grp').length > 0), 15000);
|
|
127
|
+
const fl = () => P.page.evaluate(() => ({ over: document.documentElement.scrollWidth - innerWidth, small: [...document.querySelectorAll('#czViewer .vz-row, #czViewer .vz-seg button, #czViewer [data-c="new"]')].filter((b) => { if (!b.getClientRects().length) return false; const pb = getComputedStyle(b, '::before'), hit = pb.content !== 'none' && pb.position === 'absolute' ? parseFloat(pb.height) || 0 : 0; return Math.max(b.getBoundingClientRect().height, hit) < 44; }).length })); // a press may keep its drawn size (the Agreed mockup's segment and New note) and take a 44 px hit area from ::before
|
|
149
128
|
const f0 = await fl();
|
|
150
|
-
if (
|
|
151
|
-
|
|
152
|
-
await P.page.
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
if (w === 390) ok(`N8 at 390 px (${th}) the list and the note have no sideways scroll and every press is at least 44 px`, f0.scroll && f1.scroll && f0.btn.length > 3 && [...f0.btn, ...f1.btn].every((n) => n >= 44), JSON.stringify([f0, f1]));
|
|
129
|
+
if (shotDir) await P.page.screenshot({ path: path.join(shotDir, `list-390-${th}.png`) });
|
|
130
|
+
await tap(P.page, '[data-c="note"][data-id="n3"]');
|
|
131
|
+
await until(() => P.page.evaluate(() => !!document.querySelector('#czViewer .vz-mtg [data-a="m-about"]')));
|
|
132
|
+
const f1 = await P.page.evaluate(() => ({ over: document.documentElement.scrollWidth - innerWidth }));
|
|
133
|
+
if (shotDir) await P.page.screenshot({ path: path.join(shotDir, `note-390-${th}.png`) });
|
|
134
|
+
ok(`N8 at 390 px (${th}) the list and the note have no sideways scroll and the list's presses are at least 44 px`, f0.over <= 0 && f1.over <= 0 && f0.small === 0, JSON.stringify([f0, f1]));
|
|
157
135
|
await P.ctx.close();
|
|
158
136
|
}
|
|
159
|
-
ok('N7 no page error in any run',
|
|
137
|
+
ok('N7 no page error in any run', ALL.every((x) => x.errors.length === 0), JSON.stringify(ALL.map((x) => x.errors).filter((e) => e.length)));
|
|
160
138
|
return finish();
|
|
161
139
|
})().catch((e) => { console.error(e); finish(1); });
|