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,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,118 +34,108 @@ 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 .vzc-grp > .vzm-lbl')].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 .vzc-grp').length > 0 && document.querySelector('#czViewer .vzc-tabs [data-c="tab"][data-k="notes"]').getAttribute('aria-selected') === 'true'), 15000), (await text(p)).slice(0, 300));
|
|
54
|
+
ok('N1 the card has the Calendar and Notes tabs, the search and the kind chips, and no tabs strip or conversation', await p.evaluate(() => !!document.querySelector('#czViewer [data-c="tab"][data-k="cal"]') && !!document.querySelector('#czViewer [data-c="q"]') && document.querySelectorAll('#czViewer [data-c="filter"]').length === 4 && !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-c="ser"][data-k="viewer-sync"]'); return b ? b.textContent : ''; });
|
|
64
|
+
ok('N3 the two notes of the series are one folded card: 2 notes · series, with its open steps', /2 notes · series/.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 the
|
|
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: 0 notes, no note row, the series kept folded as none match', await until(async () => /0 notes/.test(await text(p)) && /2 notes · none match/.test(await text(p)) && (await ids(p)).length === 0), (await text(p)).slice(0, 400));
|
|
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('
|
|
108
|
-
await p
|
|
109
|
-
await p.
|
|
110
|
-
|
|
111
|
-
await p.
|
|
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 a note that is not linked offers What it is about', await until(async () => /What it is about/.test(await text(p)) && !!(await p.$('#czViewer [data-a="m-about"]'))), (await text(p)).slice(0, 400));
|
|
81
|
+
await p.evaluate(() => window.czViews.openNotes({}));
|
|
82
|
+
await until(() => p.evaluate(() => !!document.querySelector('#czViewer [data-c="ser"][data-k="viewer-sync"]')));
|
|
83
|
+
await tap(p, '[data-c="ser"][data-k="viewer-sync"]');
|
|
84
|
+
ok('N3 pressing the series card unfolds its notes, newest first', await until(async () => (await ids(p)).slice(0, 2).join() === 'n1,n0'), JSON.stringify(await ids(p)));
|
|
85
|
+
await tap(p, '[data-c="note"][data-id="n1"]');
|
|
86
|
+
ok('N5 a note of the series opens and says N of M', await until(async () => /4 of 4/.test(await text(p))) && A.S.gets.some((x) => /notes\/one\?id=n1/.test(x)), (await text(p)).slice(0, 300));
|
|
87
|
+
await tap(p, '.vzm-ser [data-a="note"]');
|
|
88
|
+
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
89
|
|
|
114
90
|
/* N6 Change what it is about */
|
|
115
|
-
await p.
|
|
116
|
-
await p.
|
|
117
|
-
await
|
|
118
|
-
await p.
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
await p
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
ok('N6
|
|
91
|
+
await p.evaluate(() => window.czViews.openNotes({}));
|
|
92
|
+
await until(() => p.evaluate(() => !!document.querySelector('#czViewer [data-c="note"][data-id="n3"]')));
|
|
93
|
+
await tap(p, '[data-c="note"][data-id="n3"]');
|
|
94
|
+
await until(() => p.evaluate(() => !!document.querySelector('#czViewer [data-a="m-about"]')));
|
|
95
|
+
await tap(p, '[data-a="m-about"]');
|
|
96
|
+
const opts = await until(() => p.evaluate(() => { const s = [...document.querySelectorAll('#czViewer [data-a="aboutpick"]')]; return s.length ? s.map((o) => o.dataset.v) : null; }));
|
|
97
|
+
ok('N6 What it is about lists the initiatives, the product, the portfolio and Leave it out, with no Waiting for design marker', opts && opts.join('|') === 'i:w1/viewer|b:w1/b1|p|none' && !(await p.$('#czViewer [data-cz-placeholder]')), JSON.stringify(opts));
|
|
98
|
+
await tap(p, '[data-a="aboutpick"][data-v="i:w1/viewer"]');
|
|
99
|
+
const links = () => A.S.posts.filter((x) => x.path === '/api/notes/link');
|
|
100
|
+
await until(() => links().length === 1);
|
|
101
|
+
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()));
|
|
102
|
+
ok('N6 the note is read again and its head names the initiative', await until(async () => /Growth › Viewer/.test(await text(p)) && !(await p.$('#czViewer [data-a="aboutpick"]'))), (await text(p)).slice(0, 300));
|
|
126
103
|
|
|
127
104
|
/* N7 writes */
|
|
128
|
-
const posts = [...new Set(A.
|
|
129
|
-
ok('N7 the only write is the note\'s link', posts.join() === '
|
|
105
|
+
const posts = [...new Set(A.S.posts.map((x) => x.path))].sort();
|
|
106
|
+
ok('N7 the only write is the note\'s link', posts.join() === '/api/notes/link', posts.join());
|
|
130
107
|
const res = await fetch(BASE + '/api/notes/link', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ id: 'n-nothing', portfolio: true }) });
|
|
131
108
|
ok('N7 /api/notes/link without the launch nonce is refused', res.status === 403, String(res.status));
|
|
132
109
|
await A.ctx.close();
|
|
133
110
|
|
|
134
|
-
/*
|
|
135
|
-
const
|
|
136
|
-
ok('
|
|
111
|
+
/* N1 one initiative's notes */
|
|
112
|
+
const I = await open('/premium-viewer.html?open=notes&initiative=saved-views');
|
|
113
|
+
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)));
|
|
114
|
+
await I.ctx.close();
|
|
115
|
+
|
|
116
|
+
/* N2 an empty store says so */
|
|
117
|
+
const Z = await open('/premium-viewer.html?open=notes');
|
|
118
|
+
await Z.page.route(/\/api\/notes(\?.*)?$/, (r) => r.fulfill({ status: 200, contentType: 'application/json', body: JSON.stringify({ ok: true, notes: [], series_open: {} }) }));
|
|
119
|
+
await Z.page.reload();
|
|
120
|
+
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
121
|
await Z.ctx.close();
|
|
138
122
|
|
|
139
123
|
/* N8 floors (PMOS_SHOTS=<dir> also saves pictures) */
|
|
140
124
|
const shotDir = process.env.PMOS_SHOTS || '';
|
|
141
|
-
for (const
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
const
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
if (
|
|
152
|
-
|
|
153
|
-
await P.page.click('[data-vn-note="n3"]');
|
|
154
|
-
await until(() => P.page.evaluate(() => /Price SSO/.test((document.querySelector('#dOut .obody.vw[data-vw="meet-note"]') || {}).textContent || '')));
|
|
155
|
-
const f1 = await fl();
|
|
156
|
-
if (shotDir) await P.page.screenshot({ path: path.join(shotDir, `note-${w}-${th}.png`) });
|
|
157
|
-
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]));
|
|
125
|
+
for (const th of ['light', 'dark']) {
|
|
126
|
+
const P = await open('/premium-viewer.html?open=notes&theme=' + th, { w: 390, h: 844 });
|
|
127
|
+
await until(() => P.page.evaluate(() => document.querySelectorAll('#czViewer .vzc-grp').length > 0), 15000);
|
|
128
|
+
const fl = () => P.page.evaluate(() => ({ over: document.documentElement.scrollWidth - innerWidth, small: [...document.querySelectorAll('#czViewer .vzc-nr, #czViewer .vzc-tabs button, #czViewer [data-c="filter"]')].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
|
|
129
|
+
// the Meetings stylesheet loads after the list is drawn: measure once it applies, and fail if it never does
|
|
130
|
+
const f0 = await until(async () => { const v = await fl(); return v.small === 0 ? v : null; }, 8000) || await fl();
|
|
131
|
+
if (shotDir) await P.page.screenshot({ path: path.join(shotDir, `list-390-${th}.png`) });
|
|
132
|
+
await tap(P.page, '[data-c="note"][data-id="n3"]');
|
|
133
|
+
await until(() => P.page.evaluate(() => !!document.querySelector('#czViewer .vz-mtg [data-a="m-about"]')));
|
|
134
|
+
const f1 = await P.page.evaluate(() => ({ over: document.documentElement.scrollWidth - innerWidth }));
|
|
135
|
+
if (shotDir) await P.page.screenshot({ path: path.join(shotDir, `note-390-${th}.png`) });
|
|
136
|
+
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]));
|
|
158
137
|
await P.ctx.close();
|
|
159
138
|
}
|
|
160
|
-
ok('N7 no page error in any run',
|
|
139
|
+
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)));
|
|
161
140
|
return finish();
|
|
162
141
|
})().catch((e) => { console.error(e); finish(1); });
|