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,8 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
|
-
/* premium-vw-item-test.js — an initiative and its tasks as
|
|
4
|
-
* Serves the real
|
|
5
|
-
*
|
|
3
|
+
/* premium-vw-item-test.js — an initiative and its tasks as views of the Viewer (initiative premium-viewer, S7; planning/prd/premium-viewer-prd.md R9, R6, R7).
|
|
4
|
+
* Serves the real Home and Board pages from the real server with /api/initiative-premium and /api/board-premium answered by stand-ins built from the
|
|
5
|
+
* libraries' own fixtures. Since premium-agreed-design the initiative is a layout inside Home and the Viewer shows one item at a time (no tabs): the
|
|
6
|
+
* Overview offers Open the full record and opens each task; inside the record a task opens in its place, and the task's initiative link brings the record back.
|
|
6
7
|
* Every wait polls the page; no fixed sleep stands in for a state. */
|
|
7
8
|
const path = require('path');
|
|
8
9
|
const { spawn } = require('child_process');
|
|
@@ -42,87 +43,87 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
|
42
43
|
const open = async ({ w = 1280, h = 900, theme = 'light', answer = null } = {}) => {
|
|
43
44
|
const ctx = await browser.newContext({ viewport: { width: w, height: h } });
|
|
44
45
|
const page = await ctx.newPage();
|
|
45
|
-
const S = { errors: [], gets: [] };
|
|
46
|
+
const S = { errors: [], gets: [], vgets: [] }; // vgets: the Viewer's own reads (no page headers), apart from Home's
|
|
46
47
|
page.on('pageerror', (e) => S.errors.push(String((e && e.message) || e)));
|
|
47
|
-
await page.route('**/api/initiative-premium*', (r) => { S.gets.push(r.request().
|
|
48
|
+
await page.route('**/api/initiative-premium*', (r) => { const u = r.request().url(); S.gets.push(u); if (!r.request().headers()['x-pmos-nonce']) S.vgets.push(u); const a = answer ? answer(u, S.gets.filter((x) => x === u).length) : { status: 200, body: { ok: true, state: 'ready', model: MODEL, as_of: Date.now() } }; r.fulfill({ status: a.status, contentType: 'application/json', body: JSON.stringify(a.body) }); });
|
|
48
49
|
await page.route('**/api/briefing-premium/**', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, turns: [], working: false }) }));
|
|
49
|
-
await page.goto(BASE + '/premium
|
|
50
|
-
S.up = await until(() => page.evaluate(() => !!document.querySelector('
|
|
50
|
+
await page.goto(BASE + '/premium.html?ini=self-serve-v2&ws=w1&board=w1&theme=' + theme);
|
|
51
|
+
S.up = await until(() => page.evaluate(() => !!document.querySelector('.hm-card [data-hm-ov]') && !!window.__premiumWorkItem), 20000);
|
|
51
52
|
return { page, ctx, S };
|
|
52
53
|
};
|
|
53
|
-
const
|
|
54
|
-
const
|
|
54
|
+
const overview = async (page) => { if (!(await page.locator('.hm-card [data-hm-ov]').isVisible())) await page.click('#hmNeeds'); await page.click('.hm-card [data-hm-ov]'); /* a phone: the initiative card is in the top bar's sheet */ return until(() => page.evaluate(() => !!document.querySelector('#czViewer [data-ov-record]') && !!document.querySelector('#czViewer [data-ov-tk="task:t1"]'))); };
|
|
55
|
+
const cur = (page) => page.evaluate(() => { const p = document.querySelector('#czViewer:not([hidden]) .obody.vw'); return { on: p ? p.dataset.vw : null, title: (document.querySelector('#czVwTitle') || {}).textContent || '', n: document.querySelectorAll('#czViewer .obody.vw').length }; });
|
|
56
|
+
const paneTxt = (page, id) => page.evaluate((k) => { const p = document.querySelector(`#czViewer .obody.vw[data-vw="${CSS.escape(k)}"]`); return p ? p.textContent.replace(/\s+/g, ' ') : ''; }, id);
|
|
55
57
|
const INI = 'item:ini:self-serve-v2';
|
|
56
58
|
|
|
57
|
-
/* R9 on
|
|
59
|
+
/* R9 on Home's initiative layout, at 1280 */
|
|
58
60
|
{
|
|
59
61
|
const { page, ctx, S } = await open();
|
|
60
|
-
ok('R9 the initiative
|
|
61
|
-
|
|
62
|
-
const n0 = S.
|
|
63
|
-
|
|
64
|
-
await page.click('#oMain [data-vwopen]');
|
|
62
|
+
ok('R9 Home loads the initiative with the Viewer\'s item views', S.up);
|
|
63
|
+
ok('R9 the Overview offers Open the full record and an Open press on each task', await overview(page));
|
|
64
|
+
const n0 = S.vgets.length;
|
|
65
|
+
await page.click('#czViewer [data-ov-record]');
|
|
65
66
|
await until(async () => /Checks/.test(await paneTxt(page, INI)));
|
|
66
|
-
let s = await
|
|
67
|
-
ok('R9 the
|
|
68
|
-
ok('R9 the
|
|
69
|
-
ok('R9 the
|
|
70
|
-
await page.click(`#
|
|
67
|
+
let s = await cur(page), t = await paneTxt(page, INI);
|
|
68
|
+
ok('R9 the record opens in the Viewer in place of the Overview, one item at a time', s.on === INI && s.n === 1, JSON.stringify(s));
|
|
69
|
+
ok('R9 the record holds the record, next step, checks, tasks and links', ['planning/initiatives/self-serve-v2.md', 'q3-2026:o1:kr1', 'Dara', '30 Oct', 'Next: contract', 'Checks', 'Sandbox key step', 'UAT with five partners', 'planning/evals/self-serve-v2-eval-rubric.md'].every((x) => t.includes(x)), t.slice(0, 500));
|
|
70
|
+
ok('R9 the record loads its own stylesheet', await page.evaluate(() => !!document.querySelector('link[data-vw-css="item"]')));
|
|
71
|
+
await page.click(`#czViewer .obody.vw[data-vw="${INI}"] [data-vwtask="task:t1"]`);
|
|
71
72
|
const TK = 'item:task:self-serve-v2:task:t1';
|
|
72
73
|
await until(async () => /UAT with five partners/.test(await paneTxt(page, TK)));
|
|
73
|
-
s = await
|
|
74
|
-
ok('R9 a task inside the
|
|
75
|
-
ok('R9 the task
|
|
76
|
-
ok('R9
|
|
77
|
-
await page.click(`#
|
|
78
|
-
s = await
|
|
79
|
-
ok('R9 the initiative link brings the
|
|
80
|
-
await page.
|
|
81
|
-
|
|
82
|
-
s = await st(page);
|
|
83
|
-
ok('R9 a new dialog starts with no extra tab; the task\'s own dialog offers Open the initiative', s.ids.length === 0 && await page.evaluate(() => /Open the initiative/.test((document.querySelector('#oMain [data-vwopen]') || {}).textContent || '')), JSON.stringify(s));
|
|
74
|
+
s = await cur(page); t = await paneTxt(page, TK);
|
|
75
|
+
ok('R9 a task inside the record opens in its place, named by the task', s.on === TK && s.title === 'UAT with five partners', JSON.stringify(s));
|
|
76
|
+
ok('R9 the task shows owner, start, due and status', ['Dara', '20 Oct', '27 Oct', 'To do', 'PMOS task'].every((x) => t.includes(x)), t);
|
|
77
|
+
ok('R9 the record and its task read the route once', S.vgets.length - n0 === 1, String(S.vgets.length - n0));
|
|
78
|
+
await page.click(`#czViewer .obody.vw[data-vw="${TK}"] [data-vwini]`);
|
|
79
|
+
s = await cur(page);
|
|
80
|
+
ok('R9 the initiative link brings the record back, not a second one', await until(async () => (await cur(page)).on === INI) && (await cur(page)).n === 1, JSON.stringify(s));
|
|
81
|
+
ok('R9 the task press in the Overview opens the same task view', await overview(page) && await page.click('#czViewer [data-ov-tk="task:t1"]').then(() => until(async () => (await cur(page)).on === TK && /PMOS task/.test(await paneTxt(page, TK)))), JSON.stringify(await cur(page)));
|
|
82
|
+
ok('R9 the old dialog never opens', await page.evaluate(() => { const d = document.querySelector('#dlg'); return !d || !d.classList.contains('on'); }));
|
|
84
83
|
ok('R9 no page error', S.errors.length === 0, S.errors.join(' | '));
|
|
85
84
|
await ctx.close();
|
|
86
85
|
}
|
|
87
86
|
|
|
88
|
-
/* R6 a route that is reading, then fails */
|
|
87
|
+
/* R6 a route that is reading, then fails (only for the other initiative: Home's own read is answered) */
|
|
89
88
|
{
|
|
90
|
-
const { page, ctx, S } = await open({ answer: (n) => (
|
|
91
|
-
await page.locator('#cIniTk .tkq').first().click(); await until(() => page.evaluate(() => document.querySelector('#dlg').classList.contains('on')));
|
|
89
|
+
const { page, ctx, S } = await open({ answer: (u, n) => (!/id=other-two/.test(u) ? { status: 200, body: { ok: true, state: 'ready', model: MODEL } } : n <= 2 ? { status: 202, body: { ok: true, state: 'reading' } } : { status: 500, body: { ok: false, state: 'error', error: 'the board could not be read' } }) });
|
|
92
90
|
await page.evaluate(() => window.__premiumWorkItem.openWorkItem({ kind: 'initiative', id: 'other-two', title: 'Other' }));
|
|
93
|
-
ok('R6 while the route reads, the
|
|
91
|
+
ok('R6 while the route reads, the view says so', await until(async () => /Reading the initiative/.test(await paneTxt(page, 'item:ini:other-two')), 3000));
|
|
94
92
|
ok('R6 a failed read says what failed and invents nothing', await until(async () => /could not be read: the board could not be read/.test(await paneTxt(page, 'item:ini:other-two')), 8000), await paneTxt(page, 'item:ini:other-two'));
|
|
93
|
+
ok('R6 no page error', S.errors.length === 0, S.errors.join(' | '));
|
|
95
94
|
await ctx.close();
|
|
96
95
|
}
|
|
97
96
|
|
|
98
|
-
/* R9
|
|
97
|
+
/* R9 the Board (premium-agreed-design): the Agreed Board opens an initiative in its side panel and never the dialog; its expand leads to the
|
|
98
|
+
* initiative (Home's initiative layout), where the record is. R7 floors at 390 in dark: the same record, opened from Home's Overview. */
|
|
99
99
|
{
|
|
100
100
|
const ctx = await browser.newContext({ viewport: { width: 390, height: 844 } });
|
|
101
101
|
const page = await ctx.newPage(); const errors = [];
|
|
102
102
|
page.on('pageerror', (e) => errors.push(String((e && e.message) || e)));
|
|
103
|
-
await page.addInitScript(() => { try { localStorage.setItem('pmos.premium.openAs', 'popup'); } catch { /* none */ } });
|
|
104
103
|
await page.route('**/api/board-premium*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model: BP.build(BF.facts()), as_of: Date.now() }) }));
|
|
105
|
-
await page.route('**/api/initiative-premium*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model: MODEL, as_of: Date.now() }) }));
|
|
106
104
|
await page.route('**/api/briefing-premium/**', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, turns: [], working: false }) }));
|
|
107
105
|
await page.goto(BASE + '/premium-board.html?theme=dark');
|
|
108
106
|
const up = await until(() => page.evaluate(() => document.querySelectorAll('#ibBody [data-key]').length > 0), 20000);
|
|
109
107
|
ok('R9 the Board loads', up);
|
|
110
|
-
|
|
111
|
-
await until(() => page.evaluate(() =>
|
|
112
|
-
|
|
113
|
-
ok('R9
|
|
114
|
-
await
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
108
|
+
await page.click('#ibBody .ini2[data-key="board:self-serve-v2"]'); // a phone opens on the List view (premium-uncovered-features, BdPhone)
|
|
109
|
+
const pk = await until(() => page.evaluate(() => { const k = document.querySelector('#peek'); return k && !k.hidden ? { record: !!k.querySelector('[data-pk="record"]'), dlg: !!document.querySelector('#dlg.on'), href: (k.querySelector('[data-pk="expand"]') || {}).getAttribute ? k.querySelector('[data-pk="expand"]').getAttribute('href') : '' } : null; }));
|
|
110
|
+
ok('R9 an initiative row opens the Board\'s side panel, not the dialog, and its expand leads to the initiative page, where the record tab is', !!pk && !pk.record && !pk.dlg && /^\/premium-initiative\.html\?id=self-serve-v2&ws=w1&board=w1$/.test(pk.href), JSON.stringify(pk));
|
|
111
|
+
ok('R9 no page error on the Board', errors.length === 0, errors.join(' | '));
|
|
112
|
+
await ctx.close();
|
|
113
|
+
}
|
|
114
|
+
{
|
|
115
|
+
const { page, ctx, S } = await open({ w: 390, h: 844, theme: 'dark' });
|
|
116
|
+
await overview(page);
|
|
117
|
+
await page.click('#czViewer [data-ov-record]');
|
|
118
|
+
await until(async () => /Checks/.test(await paneTxt(page, INI)));
|
|
118
119
|
const fl = await page.evaluate((k) => {
|
|
119
|
-
const p = document.querySelector(`#
|
|
120
|
+
const p = document.querySelector(`#czViewer .obody.vw[data-vw="${CSS.escape(k)}"]`);
|
|
120
121
|
const small = [...p.querySelectorAll('button, a')].filter((b) => b.offsetParent && b.getBoundingClientRect().height < 44).map((b) => b.textContent.trim().slice(0, 30));
|
|
121
122
|
return { wide: document.documentElement.scrollWidth <= 390, small, bg: getComputedStyle(p.querySelector('.vwi-l') || p).backgroundColor };
|
|
122
|
-
},
|
|
123
|
+
}, INI);
|
|
123
124
|
ok('R7 at 390px in dark: no sideways scroll, every press at least 44px', fl.wide && fl.small.length === 0, JSON.stringify(fl));
|
|
124
125
|
ok('R7 dark theme cards are dark', /rgba?\((\d+), (\d+), (\d+)/.test(fl.bg) && +RegExp.$1 < 80, fl.bg);
|
|
125
|
-
ok('
|
|
126
|
+
ok('R7 no page error at 390px in dark', S.errors.length === 0, S.errors.join(' | '));
|
|
126
127
|
await ctx.close();
|
|
127
128
|
}
|
|
128
129
|
finish();
|
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
/* premium-vw-jira-test.js — the Jira tabs of the premium viewer in a real browser (initiative premium-viewer S5; planning/prd/premium-viewer-prd.md R5 to R7).
|
|
4
4
|
* A real server; the Board page's model and the two Jira reads are route stand-ins (GET /api/board-premium, /api/boards/sprints, /api/jira/tickets), since
|
|
5
5
|
* Jira readings are written only by an agent session holding the PM's Atlassian connection.
|
|
6
|
-
* B the
|
|
6
|
+
* B the sprint as a board by status in a viewer tab · K a card opens its ticket · N no Jira data says so · A the Agreed Board's sprint chip
|
|
7
|
+
* Re-pointed for premium-agreed-design: the Agreed Board has no Sprint card and opens no dialog (its sprint chip shows "Waiting for design"),
|
|
8
|
+
* so the sprint view is opened through its module (openSprint) over a task dialog of the initiative page, which loads the same view.
|
|
7
9
|
* F floors: 390 px with no sideways scroll, 44 px targets, light and dark, no write */
|
|
8
10
|
const path = require('path');
|
|
9
11
|
const { spawn } = require('child_process');
|
|
@@ -11,6 +13,8 @@ const { findBrowser } = require('./lib/find-browser');
|
|
|
11
13
|
const T = require('./test-run').configure({ name: 'premium-vw-jira' });
|
|
12
14
|
const BP = require('./lib/board-premium.js');
|
|
13
15
|
const F = require('./fixtures/board-premium-facts.js');
|
|
16
|
+
const IP = require('./lib/initiative-premium.js');
|
|
17
|
+
const IF = require('./fixtures/initiative-premium-facts.js');
|
|
14
18
|
|
|
15
19
|
const BASE = T.BASE;
|
|
16
20
|
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
@@ -65,9 +69,13 @@ const TICKETS = {
|
|
|
65
69
|
browser = await chromium.launch({ executablePath: exe });
|
|
66
70
|
|
|
67
71
|
const model = (sprints) => BP.build(F.facts({ sprints }));
|
|
72
|
+
const IMODEL = IP.build(IF.facts());
|
|
73
|
+
// Home's initiative layout (premium-agreed-design): the card's Overview has the Sprint press; the Viewer shows one item at a time
|
|
74
|
+
const overview = async (pg) => { if (!(await pg.locator('.hm-card [data-hm-ov]').isVisible())) await pg.click('#hmNeeds'); await pg.click('.hm-card [data-hm-ov]'); /* a phone: the initiative card is in the top bar's sheet */ return until(() => pg.evaluate(() => !!document.querySelector('#czViewer [data-ov-sprint]'))); };
|
|
75
|
+
const openSprint = async (pg) => { if (!(await pg.$('#czViewer:not([hidden]) [data-ov-sprint]'))) await overview(pg); /* open() already showed the Overview */ await pg.click('#czViewer [data-ov-sprint]'); };
|
|
68
76
|
const open = async ({ w = 1280, h = 900, theme = 'light', sprints = SPRINTS, tickets = TICKETS } = {}) => {
|
|
69
77
|
const ctx = await browser.newContext({ viewport: { width: w, height: h }, colorScheme: theme });
|
|
70
|
-
await ctx.addInitScript((t) => { try { localStorage.setItem('pmos.
|
|
78
|
+
await ctx.addInitScript((t) => { try { localStorage.setItem('pmos.c3.theme', t); } catch { /* none */ } }, theme);
|
|
71
79
|
const page = await ctx.newPage(), errors = [], posts = [], reads = [];
|
|
72
80
|
page.on('pageerror', (e) => errors.push(String((e && e.message) || e)));
|
|
73
81
|
page.on('request', (rq) => { const u = new URL(rq.url()); if (rq.method() === 'POST') posts.push(u.pathname); if (/^\/api\/(jira|boards\/sprints)/.test(u.pathname)) reads.push(u.pathname + u.search); });
|
|
@@ -75,20 +83,24 @@ const TICKETS = {
|
|
|
75
83
|
await page.route('**/api/board-premium*', (r) => json(r, { ok: true, state: 'ready', model: model(sprints), as_of: Date.now() }));
|
|
76
84
|
await page.route('**/api/boards/sprints*', (r) => json(r, sprints));
|
|
77
85
|
await page.route('**/api/jira/tickets*', (r) => json(r, tickets));
|
|
78
|
-
await page.
|
|
79
|
-
await
|
|
86
|
+
await page.route('**/api/initiative-premium*', (r) => json(r, { ok: true, state: 'ready', model: IMODEL, as_of: Date.now() }));
|
|
87
|
+
await page.route('**/api/briefing-premium/**', (r) => json(r, { ok: true, turns: [], working: false }));
|
|
88
|
+
await page.goto(BASE + '/premium-initiative.html?id=self-serve-v2&ws=w1&board=w1&theme=' + theme); // the Board's expand link: Home with the initiative
|
|
89
|
+
await until(() => page.evaluate(() => !!document.querySelector('.hm-card [data-hm-ov]') && !!window.__premiumVwJira), 20000);
|
|
90
|
+
await overview(page);
|
|
91
|
+
await sleep(300); reads.length = 0; posts.length = 0; // Home's own reads; the checks below are about the sprint view's
|
|
80
92
|
return { ctx, page, errors, posts, reads };
|
|
81
93
|
};
|
|
82
|
-
const
|
|
83
|
-
const paneText = (p, id) => p.evaluate((x) => { const e = document.querySelector(`#
|
|
94
|
+
const curId = (p) => p.evaluate(() => { const e = document.querySelectorAll('#czViewer:not([hidden]) .obody.vw'); return e.length === 1 ? e[0].dataset.vw : [...e].map((x) => x.dataset.vw).join(); });
|
|
95
|
+
const paneText = (p, id) => p.evaluate((x) => { const e = document.querySelector(`#czViewer:not([hidden]) .obody.vw[data-vw="${CSS.escape(x)}"]`); return e && !e.hidden ? e.textContent : null; }, id);
|
|
84
96
|
|
|
85
97
|
/* B the sprint */
|
|
86
98
|
const A = await open();
|
|
87
99
|
const p = A.page;
|
|
88
|
-
await p.evaluate(() =>
|
|
89
|
-
await p
|
|
100
|
+
const mainTxt = await p.evaluate(() => document.querySelector('#czViewer .cz-vw-body').textContent); // the Overview
|
|
101
|
+
await openSprint(p);
|
|
90
102
|
const board = await until(async () => { const t = await paneText(p, 'sprint:w1'); return t && /Migration check/.test(t) ? t : null; });
|
|
91
|
-
ok('B1 the
|
|
103
|
+
ok('B1 the sprint view opens in the Viewer in place of the Overview', !!board && (await curId(p)) === 'sprint:w1', JSON.stringify(await curId(p)));
|
|
92
104
|
ok('B2 the board names the sprint, its dates, goal, days left and points from the read', /Sprint 14 · 7 Oct – 21 Oct/.test(board) && /Sprint goal · from the tickets/i.test(board) && /Ship guided setup/.test(board) && /Three tickets on guided setup/.test(board) && /In Jira: “Setup”/.test(board) && /2 days left/.test(board) && /3 of 10 points done/.test(board), board);
|
|
93
105
|
const cols = await p.evaluate(() => [...document.querySelectorAll('.jcol')].map((c) => c.querySelector('.jcolh').textContent + ':' + c.querySelectorAll('.jcrd').length).join());
|
|
94
106
|
ok('B3 the cards sit in To do, In progress and Done by the reading\'s category', cols === 'To do2:2,In progress1:1,Done1:1', cols);
|
|
@@ -105,9 +117,9 @@ const TICKETS = {
|
|
|
105
117
|
ok('B11 shut again, the fold stays shut on the active sprint', await p.evaluate(() => document.querySelector('#jpast').hidden));
|
|
106
118
|
await p.click('.jcrd[data-k="OPS-9"]');
|
|
107
119
|
const o9 = await until(async () => { const t = await paneText(p, 'jira:OPS-9'); return t && /Rotate keys/.test(t) ? t : null; });
|
|
108
|
-
ok('B12 a ticket on no initiative opens its tab from the sprint read, with its Jira link', !!o9 && /on no initiative of this board/.test(o9) && await p.evaluate(() => [...document.querySelectorAll('#
|
|
109
|
-
await p
|
|
110
|
-
ok('B6 the view says it is read-only and moves nothing', /Read-only: Jira owns each ticket's status and sprint/.test(board) && !(await p.$('#
|
|
120
|
+
ok('B12 a ticket on no initiative opens its tab from the sprint read, with its Jira link', !!o9 && /on no initiative of this board/.test(o9) && await p.evaluate(() => [...document.querySelectorAll('#czViewer .obody.vw a[href]')].some((a) => a.href === 'https://acme.atlassian.net/browse/OPS-9')), o9);
|
|
121
|
+
await openSprint(p); await until(async () => /Migration check/.test((await paneText(p, 'sprint:w1')) || '')); // back to the sprint: one item at a time
|
|
122
|
+
ok('B6 the view says it is read-only and moves nothing', /Read-only: Jira owns each ticket's status and sprint/.test(board) && !(await p.$('#czViewer .obody.vw [draggable="true"]')));
|
|
111
123
|
await p.click('.jseg [data-sp="Sprint 15"]');
|
|
112
124
|
ok('B7 the other sprint is one press away, and an empty one draws empty columns', !!(await until(async () => { const t = await paneText(p, 'sprint:w1'); return t && /Sprint 15 · 22 Oct – 4 Nov/.test(t) && /No goal yet\. The Jira status check writes one from the tickets/.test(t) && (t.match(/None/g) || []).length === 3; })));
|
|
113
125
|
await p.click('.jseg [data-sp="Sprint 14"]');
|
|
@@ -116,19 +128,19 @@ const TICKETS = {
|
|
|
116
128
|
/* K the ticket */
|
|
117
129
|
await p.click('.jcrd[data-k="PMOS-142"]');
|
|
118
130
|
const tk = await until(async () => { const t = await paneText(p, 'jira:PMOS-142'); return t && /Acceptance Criteria/.test(t) ? t : null; });
|
|
119
|
-
ok('K1 a card opens its ticket
|
|
131
|
+
ok('K1 a card opens its ticket in place of the sprint', !!tk && (await curId(p)) === 'jira:PMOS-142', JSON.stringify(await curId(p)));
|
|
120
132
|
ok('K2 the ticket shows key, title, status, sprint, points and priority', /PMOS-142/.test(tk) && /Migration check for older workspaces/.test(tk) && /To Do/.test(tk) && /Sprint 14 · active/.test(tk) && /5 pt/.test(tk) && /High/.test(tk), tk);
|
|
121
133
|
ok('K3 the description is the draft\'s sections, rendered as markdown with nothing run', /User Story/.test(tk) && await p.evaluate(() => !!document.querySelector('.jmd strong') && !document.querySelector('.jmd img[onerror]') && !window.__pwned));
|
|
122
134
|
ok('K4 subtasks are the reading\'s count, and links come from the draft', /Subtasks · 1 of 3 done/.test(tk) && /blocks/.test(tk) && /PMOS-152/.test(tk) && /planning\/prd\/self-serve-v2-prd.md/.test(tk));
|
|
123
135
|
ok('K5 no comments, history or fields panel: a line sends the rest to Jira with a real link', /Comments, history and the other fields stay in Jira/.test(tk) && /Jira owns the status and the assignee/.test(tk)
|
|
124
136
|
&& /Assignee\s*Not in the Jira read/.test(tk) && /Jira\s*Read (\d+ (min|hours?|days?) ago|just now)/.test(tk) && !/pull request|\bPR\b|builder/i.test(tk) && !/Comments \(/.test(tk)
|
|
125
|
-
&& await p.evaluate(() => [...document.querySelectorAll('#
|
|
126
|
-
await p.click('#
|
|
137
|
+
&& await p.evaluate(() => [...document.querySelectorAll('#czViewer .obody.vw a[href]')].every((a) => a.href === 'https://acme.atlassian.net/browse/PMOS-142' && a.target === '_blank' && /noopener/.test(a.rel))));
|
|
138
|
+
await p.click('#czViewer .obody.vw [data-jt="PMOS-152"]');
|
|
127
139
|
ok('K6 a linked ticket opens in its own tab', !!(await until(async () => { const t = await paneText(p, 'jira:PMOS-152'); return t && /Release to existing workspaces/.test(t) && /No sprint/.test(t); })));
|
|
128
|
-
await p.click('#
|
|
129
|
-
const k7 = await until(() => p.evaluate(() => { const m = document.querySelector('#
|
|
130
|
-
ok('K7 the
|
|
131
|
-
ok('K8 the views read the two Jira routes only, and wrote nothing', A.posts.filter((x) => !/thread|note/.test(x)).length === 0 && A.reads.every((r) => /^\/api\/(jira\/tickets|boards\/sprints)\?/.test(r)) && A.reads.some((r) => /jira\/tickets\?.*initiative=self-serve-v2/.test(r)), JSON.stringify([A.posts, A.reads]));
|
|
140
|
+
if (!(await p.locator('.hm-card [data-hm-ov]').isVisible())) await p.click('#hmNeeds'); await p.click('.hm-card [data-hm-ov]');
|
|
141
|
+
const k7 = await until(() => p.evaluate((t0) => { const m = document.querySelector('#czViewer:not([hidden]) .cz-vw-body'); return m && m.textContent === t0 ? m.textContent : null; }, mainTxt));
|
|
142
|
+
ok('K7 the Overview comes back with its own facts, as before', !!k7, await p.evaluate(() => ((document.querySelector('#czViewer .cz-vw-body') || {}).textContent || '').slice(0, 300)));
|
|
143
|
+
ok('K8 the views read the two Jira routes only, and wrote nothing', A.posts.filter((x) => !/thread|note|seen/.test(x)).length === 0 && A.reads.every((r) => /^\/api\/(jira\/tickets|boards\/sprints)\?/.test(r)) && A.reads.some((r) => /jira\/tickets\?.*initiative=self-serve-v2/.test(r)), JSON.stringify([A.posts, A.reads]));
|
|
132
144
|
ok('K9 no page error', A.errors.length === 0, A.errors.join(' | '));
|
|
133
145
|
await A.ctx.close();
|
|
134
146
|
|
|
@@ -150,7 +162,7 @@ const TICKETS = {
|
|
|
150
162
|
await Q.page.evaluate(async () => { const m = await import('/pm/premium-vw-jira.js'); m.openTicket({ ws: 'w1', board: 'w1', initiative: 'self-serve-v2', ref: 'IDPF-2611' }); });
|
|
151
163
|
const q = await until(async () => { const x = await paneText(Q.page, 'jira:IDPF-2611'); return x && /Not read yet/.test(x) ? x : null; });
|
|
152
164
|
ok('N3 a ticket nothing stored holds says Not read yet, when Jira was last read, and offers Read it now (popup context slice 4)', !!q && /Not read yet: IDPF-2611\. The last Jira read \(read \d\d:\d\d\) does not hold it/.test(q) && /Read it now/.test(q)
|
|
153
|
-
&& Q.reads.some((r) => /^\/api\/jira\/ticket\?.*key=IDPF-2611/.test(r)) && Q.posts.length === 0, q || JSON.stringify(Q.reads));
|
|
165
|
+
&& Q.reads.some((r) => /^\/api\/jira\/ticket\?.*key=IDPF-2611/.test(r)) && Q.posts.filter((x) => !/seen/.test(x)).length === 0, q || JSON.stringify(Q.reads));
|
|
154
166
|
await Q.ctx.close();
|
|
155
167
|
// the route itself: a ticket no snapshot holds is found in the stored Jira source read, with what the read says and when
|
|
156
168
|
const fs = require('fs'), path = require('path');
|
|
@@ -162,24 +174,38 @@ const TICKETS = {
|
|
|
162
174
|
&& g2.ticket === null && g2.jira_read_at === '2026-10-21T07:02:00.000Z' && g3.ticket && g3.ticket.key === 'IDPF-2611', JSON.stringify([g1, g2]));
|
|
163
175
|
}
|
|
164
176
|
|
|
165
|
-
/* I the initiative
|
|
177
|
+
/* I the initiative (Home's layout, reached by the Board's expand link) loads the ticket view for its Jira tasks; a Jira task's Open press opens its ticket */
|
|
166
178
|
{
|
|
167
179
|
const I = await open();
|
|
168
|
-
await I.page.
|
|
169
|
-
ok('
|
|
180
|
+
await I.page.click('#czViewer [data-ov-tk="task:ONB-12"]');
|
|
181
|
+
ok('I2 a Jira task in the Overview opens its ticket in the Viewer', !!(await until(async () => (await curId(I.page)) === 'jira:ONB-12')), JSON.stringify(await curId(I.page)));
|
|
182
|
+
await I.page.goto(BASE + '/premium-initiative.html?id=self-serve-v2&ws=w1&board=w1');
|
|
183
|
+
ok('I1 the initiative loads the Jira view module without a page error', !!(await until(() => I.page.evaluate(() => !!window.__premiumVwJira))) && I.errors.length === 0, I.errors.join(' | '));
|
|
170
184
|
await I.ctx.close();
|
|
171
185
|
}
|
|
172
186
|
|
|
187
|
+
/* A the Board (premium-uncovered-features, BdSprint): its sprint chip names the sprint and opens the Sprints and releases popover; it opens no dialog */
|
|
188
|
+
{
|
|
189
|
+
const ctx = await browser.newContext({ viewport: { width: 1280, height: 900 } }), pg = await ctx.newPage(), errs = [];
|
|
190
|
+
pg.on('pageerror', (e) => errs.push(String((e && e.message) || e)));
|
|
191
|
+
await pg.route('**/api/board-premium*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model: model({ source: 'jira', readAt: new Date().toISOString(), sprints: [{ name: 'Sprint 14', state: 'active', start: '2026-10-07', end: '2026-10-21', counts: { todo: 2, doing: 1, done: 1 }, issues: [] }] }), as_of: Date.now() }) }));
|
|
192
|
+
await pg.goto(BASE + '/premium-board.html');
|
|
193
|
+
await until(() => pg.evaluate(() => !!document.querySelector('#chSprint')), 20000);
|
|
194
|
+
const chip = await pg.evaluate(() => document.querySelector('#chSprint').textContent.trim());
|
|
195
|
+
await pg.click('#chSprint');
|
|
196
|
+
ok('A1 the Board\'s sprint chip names the sprint and opens the Sprints and releases popover, which lists it from Jira, never the dialog', chip === 'Sprint 14' && await until(() => pg.evaluate(() => (() => { const p = document.querySelector('#bdPop'); return !!p && !p.hidden && p.getAttribute('aria-label') === 'Sprints and releases' && /Sprints · from Jira/.test(p.textContent) && !!p.querySelector('[data-sprint="Sprint 14"]'); })() && !!!document.querySelector('#dlg.on') && !document.querySelector('#cSpr'))), chip);
|
|
197
|
+
ok('A2 no page error on the Board', errs.length === 0, errs.join(' | '));
|
|
198
|
+
await ctx.close();
|
|
199
|
+
}
|
|
200
|
+
|
|
173
201
|
/* F floors */
|
|
174
202
|
for (const theme of ['light', 'dark']) {
|
|
175
203
|
const S = await open({ w: 390, h: 844, theme });
|
|
176
|
-
await S.page
|
|
177
|
-
await S.page.click('#cSpr [data-open="board:sprint"]');
|
|
204
|
+
await openSprint(S.page);
|
|
178
205
|
await until(() => S.page.$('.jcrd[data-k="PMOS-142"]'));
|
|
179
|
-
await S.page.evaluate(() => { const d = document.querySelector('#dlg'); if (d) d.classList.add('vopen'); const b = document.querySelector('#dTabs button[data-t="out"]'); if (b) b.click(); });
|
|
180
206
|
await sleep(400);
|
|
181
207
|
const f = await S.page.evaluate(() => {
|
|
182
|
-
const pane = document.querySelector('#
|
|
208
|
+
const pane = document.querySelector('#czViewer:not([hidden]) .obody.vw');
|
|
183
209
|
const small = [...pane.querySelectorAll('button.jcrd,.jseg button,.jbtn')].filter((b) => b.getBoundingClientRect().height && b.getBoundingClientRect().height < 44).map((b) => b.textContent.trim().slice(0, 30));
|
|
184
210
|
const crd = getComputedStyle(pane.querySelector('.jcrd')).backgroundColor, ink = getComputedStyle(pane.querySelector('.jcrd b')).color;
|
|
185
211
|
return { wide: document.documentElement.scrollWidth > innerWidth + 1, paneWide: pane.scrollWidth > pane.clientWidth + 1, small, crd, ink };
|