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,21 +1,31 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
|
-
/* briefing-premium-initiative-test.js — the
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
3
|
+
/* briefing-premium-initiative-test.js — the initiative (initiative briefing-premium-initiative; planning/prd/briefing-premium-initiative-prd.md I1 to I12),
|
|
4
|
+
* re-pointed for premium-agreed-design: the initiative is a layout inside Home (/premium.html?ini=<id>), not a page of its own, and the old
|
|
5
|
+
* /premium-initiative.html?id= link lands there. The card at the top of the chat is the mockup's ("Inside one initiative"); its Overview press opens
|
|
6
|
+
* the minimal Overview in the Viewer (stage, lifecycle, tasks, core documents; Waiting for design). What moved elsewhere has its own suite:
|
|
7
|
+
* a document's page premium-vw-doc-test.js, Add a document briefing-premium-adddoc-test.js, Issue it premium-core-doc-issue-test.js, the record and
|
|
8
|
+
* task views premium-vw-item-test.js, the Jira views premium-vw-jira-test.js. The old page's List / By stage / Timeline views, the document filter
|
|
9
|
+
* and search and the document sheet's tabs have no place in the Agreed design and are not drawn.
|
|
10
|
+
* Serves the real page from the real server. Most checks answer GET /api/initiative-premium with the model lib/initiative-premium.js builds from a
|
|
11
|
+
* fixture and GET /api/board-premium with lib/board-premium.js's; the last block reads this repository's own initiative through the real route.
|
|
12
|
+
* I1 place · I2 reading · I3 header · I4 overview (Tasks, Documents, Stage: premium-uncovered-features) · I6 tasks · I7 documents · I10 presses · I12 floors and fidelity */
|
|
7
13
|
const path = require('path');
|
|
8
14
|
const { spawn } = require('child_process');
|
|
9
15
|
const { findBrowser } = require('./lib/find-browser');
|
|
10
16
|
const T = require('./test-run').configure({ name: 'briefing-premium-initiative' });
|
|
11
17
|
const IP = require('./lib/initiative-premium.js');
|
|
12
18
|
const F = require('./fixtures/initiative-premium-facts.js');
|
|
19
|
+
const BP = require('./lib/board-premium.js');
|
|
20
|
+
const BF = require('./fixtures/board-premium-facts.js');
|
|
21
|
+
const BRP = require('./lib/briefing-premium.js');
|
|
22
|
+
const BRF = require('./fixtures/briefing-premium-facts.js');
|
|
13
23
|
|
|
14
24
|
const BASE = T.BASE;
|
|
15
25
|
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
16
26
|
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); } };
|
|
17
27
|
const results = [];
|
|
18
|
-
const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + extra : ''}`); };
|
|
28
|
+
const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + String(extra).slice(0, 600) : ''}`); };
|
|
19
29
|
let srv = null; let browser = null;
|
|
20
30
|
const finish = async (code) => {
|
|
21
31
|
if (browser) await browser.close().catch(() => {});
|
|
@@ -28,9 +38,9 @@ const finish = async (code) => {
|
|
|
28
38
|
process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
29
39
|
|
|
30
40
|
const mk = (o) => IP.build(F.facts(o));
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
const
|
|
41
|
+
const BOARD = BP.build(BF.facts());
|
|
42
|
+
const BRIEF = BRP.build(BRF.facts());
|
|
43
|
+
const WRITES = /^\/api\/(?:boards\/(?:move|tasks\/(?:add|state))|lifecycle|core-docs\/draft)$/;
|
|
34
44
|
|
|
35
45
|
(async () => {
|
|
36
46
|
const exe = findBrowser();
|
|
@@ -41,295 +51,170 @@ const HEALTH = { ok: true, path: 'planning/prd/self-serve-v2-prd.md', health: {
|
|
|
41
51
|
await T.waitForServer(BASE);
|
|
42
52
|
browser = await chromium.launch({ executablePath: exe });
|
|
43
53
|
|
|
44
|
-
const open = async ({ w = 1280, h = 900, theme = 'light', model = mk(), answers = null,
|
|
54
|
+
const open = async ({ w = 1280, h = 900, theme = 'light', model = mk(), answers = null, url = '/premium.html?ini=self-serve-v2&ws=w1&board=w1' } = {}) => {
|
|
45
55
|
const ctx = await browser.newContext({ viewport: { width: w, height: h } });
|
|
46
56
|
const page = await ctx.newPage();
|
|
47
|
-
let
|
|
57
|
+
let current = model, calls = 0, answer = { status: 200, body: { ok: true } };
|
|
58
|
+
const errors = [], posts = [];
|
|
48
59
|
page.on('pageerror', (e) => errors.push(String((e && e.message) || e)));
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
await page.route('**/api/
|
|
52
|
-
await page.route(/\/api\/
|
|
53
|
-
await page.route(
|
|
54
|
-
|
|
55
|
-
await page.route('**/api/
|
|
56
|
-
await page.
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
const up = await until(() => page.evaluate(() => document.querySelector('#cIniTk') || /could not be read|No initiative|not on a board/.test(document.querySelector('#snap').textContent + document.querySelector('#iMain').textContent)), 20000);
|
|
61
|
-
return { ctx, page, errors, posts, gets, up, calls: () => calls, setModel: (m) => { current = m; }, set: (a) => { answer = a; }, setThread: (t) => { thread = t; } };
|
|
60
|
+
page.on('request', (rq) => { if (rq.method() === 'POST') posts.push({ path: new URL(rq.url()).pathname, body: JSON.parse(rq.postData() || '{}'), headers: rq.headers() }); });
|
|
61
|
+
const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'application/json', body: JSON.stringify(b) });
|
|
62
|
+
await page.route('**/api/initiative-premium*', (r) => { calls++; if (answers) { const a = answers(calls, r.request().url()); return json(r, a.body, a.status); } return json(r, { ok: true, state: 'ready', model: current, as_of: Date.now() }); });
|
|
63
|
+
await page.route(/\/api\/board-premium(\?.*)?$/, (r) => json(r, { ok: true, state: 'ready', model: BOARD, as_of: Date.now() }));
|
|
64
|
+
await page.route(/\/api\/briefing-premium(\?.*)?$/, (r) => json(r, { ok: true, state: 'ready', model: BRIEF, as_of: Date.now() }));
|
|
65
|
+
for (const p of ['**/api/boards/move', '**/api/boards/tasks/**', '**/api/lifecycle', '**/api/core-docs/draft']) await page.route(p, (r) => json(r, answer.body, answer.status));
|
|
66
|
+
await page.route('**/api/briefing-premium/**', (r) => json(r, { ok: true, turns: [], working: false }));
|
|
67
|
+
await page.goto(BASE + url + (url.includes('?') ? '&' : '?') + 'theme=' + theme);
|
|
68
|
+
// ready: the card is drawn and the board's initiatives are read (the switcher and the card's kind line come from them)
|
|
69
|
+
const up = await ready(page, !answers);
|
|
70
|
+
return { ctx, page, errors, posts, up, calls: () => calls, setModel: (m) => { current = m; }, set: (a) => { answer = a; } };
|
|
62
71
|
};
|
|
72
|
+
const V = '#czViewer:not([hidden])';
|
|
73
|
+
// ready: the card is drawn from the board's row (kind · anchor) and, when the initiative reads, from its record (the ladder)
|
|
74
|
+
async function ready(page, full = true) { return until(() => page.evaluate((f) => !!document.querySelector('.hm-card [data-hm-ov]') && /·/.test((document.querySelector('.hm-card .hm-sw .k') || {}).textContent || '') && (!f || !!((document.querySelector('.hm-card .hm-lad b') || {}).textContent || '').trim()), full), 30000); }
|
|
75
|
+
const txt = (p, s) => p.evaluate((q) => ((document.querySelector(q) || {}).textContent || '').replace(/\s+/g, ' ').trim(), s);
|
|
76
|
+
// the Overview opens on Tasks, with Documents and Stage beside it (premium-uncovered-features, canvas InTasks, InDocs, InStage); view names the one to show
|
|
77
|
+
const show = async (p, view) => { await p.click(`${V} [data-hi-view="${view}"]`); return until(() => p.evaluate((a) => !!document.querySelector(a[0] + ` [data-hi-v="${a[1]}"]`), [V, view])); };
|
|
78
|
+
const overview = async (p, view = 'stage') => {
|
|
79
|
+
if (!(await p.evaluate(() => { const b = document.querySelector('.hm-card [data-hm-ov]'); return !!b && !!b.offsetParent; }))) await p.click('#hmNeeds'); // a phone shows the list (and its card) in the sheet
|
|
80
|
+
await p.click('.hm-card [data-hm-ov]');
|
|
81
|
+
const s = await until(() => p.evaluate((v) => { const o = document.querySelector(v); if (!o) return null; if (o.querySelector('[data-hi-view]')) return 'ok'; return /could not be read/.test(o.textContent) ? 'err' : null; }, V), 30000);
|
|
82
|
+
if (s === 'ok' && view) await show(p, view);
|
|
83
|
+
return !!s; };
|
|
84
|
+
const writes = (X) => X.posts.filter((x) => WRITES.test(x.path));
|
|
63
85
|
|
|
64
|
-
const A = await open();
|
|
65
|
-
ok('0 the
|
|
66
|
-
if (!A.up) return finish(1);
|
|
67
|
-
const p = A.page, M = mk();
|
|
68
|
-
const txt = (s) => p.evaluate((q) => (document.querySelector(q) || {}).textContent || '', s);
|
|
69
|
-
const all = (s) => p.evaluate((q) => [...document.querySelectorAll(q)].map((e) => e.textContent.trim()), s);
|
|
86
|
+
const A = await open(), p = A.page;
|
|
87
|
+
ok('0 Home draws the initiative layout: its card at the top of the list', A.up && await p.evaluate(() => new URLSearchParams(location.search).get('ini') === 'self-serve-v2' && !!document.querySelector('#hmChat .hm-card, .hm-card')));
|
|
70
88
|
|
|
71
89
|
/* I1 place */
|
|
72
|
-
// the Agreed design (premium-agreed-design N1): the floating place menu replaces the rail on screen, and this page belongs to Home
|
|
73
|
-
const nav = await p.evaluate(() => ({ rail: getComputedStyle(document.querySelector('.rail')).display, fab: document.querySelector('#czFab').getAttribute('aria-label'), names: [...document.querySelectorAll('#czMenu a, #czMenu button')].map((b) => b.textContent.trim()), cur: document.querySelector('#czMenu [aria-current="page"]').textContent.trim() }));
|
|
74
|
-
ok('I1 the floating menu names Home, Board, Insights and Settings, marks Home, and the rail is off screen', nav.rail === 'none' && nav.names.join() === 'Home,Board,Insights,Settings' && nav.cur === 'Home' && nav.fab === 'Open the menu. You are in Home', JSON.stringify(nav));
|
|
75
|
-
{ await p.click('#moreBtn'); const tc = await p.evaluate(() => { const a = document.querySelector('#toConsole'); if (!a) return null; const r = a.getBoundingClientRect(); return { href: a.getAttribute('href'), label: a.getAttribute('aria-label'), w: Math.round(r.width), h: Math.round(r.height), tab: a.tabIndex }; }); ok('I1 the ⋯ menu links to the console (premium-console-link, premium-topbar)', tc && tc.href === '/console.html' && tc.label === 'Open the console' && tc.w >= 44 && tc.h >= 44 && tc.tab === 0, JSON.stringify(tc)); await p.keyboard.press('Escape'); }
|
|
76
|
-
ok('I1 the bar has a back button to the board, the initiative with its switcher, and no chat button (Chat is in the rail)', await p.evaluate(() => document.querySelector('#crBoard').getAttribute('aria-label') === 'Back to Onboarding' && document.querySelector('#crIni').textContent === 'Self-serve onboarding v2' && !document.querySelector('#crSw') && !!document.querySelector('#crSw2') && !document.querySelector('#crAsk')));
|
|
77
|
-
await p.route('**/premium-board.html*', (r) => r.fulfill({ contentType: 'text/html', body: '<title>b</title>' }));
|
|
78
|
-
await p.route('**/premium-initiative.html?id=partner*', (r) => r.fulfill({ contentType: 'text/html', body: '<title>i</title>' }));
|
|
79
|
-
await p.click('#crSw2'); const im = await p.evaluate(() => [...document.querySelectorAll('#crMenu button')].map((b) => b.textContent + (b.hasAttribute('aria-current') ? '*' : '')).join('|'));
|
|
80
|
-
ok('I1 the initiative switcher lists the board\'s initiatives and marks this one', im === 'Self-serve onboarding v2*|Partner API rate limits|Usage-based billing', im);
|
|
81
|
-
await p.click('#crMenu [data-swi="partner-rate-limits"]'); await sleep(500);
|
|
82
|
-
{ const u = new URL(p.url()); ok('I1 choosing an initiative opens its page on the same board', u.pathname === '/premium-initiative.html' && u.searchParams.get('id') === 'partner-rate-limits' && u.searchParams.get('board') === 'w1', p.url()); await p.goBack(); await until(() => p.evaluate(() => !!document.querySelector('#cIniTk'))); }
|
|
83
|
-
await p.click('#crBoard'); await sleep(500);
|
|
84
|
-
{ const u = new URL(p.url()); ok('I1 the back button leads back to the Board', u.pathname === '/premium-board.html' && u.searchParams.get('board') === 'w1', p.url()); await p.goBack(); await until(() => p.evaluate(() => !!document.querySelector('#cIniTk'))); }
|
|
85
|
-
// the Agreed design: the card's C button opens the initiative's own conversation with Claude (the thread key the Chat page used, init:<id>)
|
|
86
|
-
{ const nT = A.posts.length; await p.click('#czBox [data-czov]'); await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on')), 10000); await sleep(300);
|
|
87
|
-
const t = await p.evaluate(() => ({ title: document.querySelector('#dTitle').textContent, label: document.querySelector('#czBox [data-czov]').getAttribute('aria-label') }));
|
|
88
|
-
ok('I1 the header card\'s C button opens the initiative\'s conversation with Claude, and sends nothing', t.title === 'Self-serve onboarding v2' && t.label === 'Overview of Self-serve onboarding v2 with Claude' && A.posts.length === nT, JSON.stringify(t));
|
|
89
|
-
await p.keyboard.press('Escape'); await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on'))); }
|
|
90
|
-
|
|
91
|
-
/* I3 header */
|
|
92
|
-
const head = await p.evaluate(() => ({ chip: document.querySelector('.ihead .chp').textContent.trim(), tone: document.querySelector('.ihead .chp').className, meta: document.querySelector('.ihm').textContent, segs: [...document.querySelectorAll('#czBox .cz-ladder i')].map((i) => i.className).join('|'), cur: document.querySelector('#czBox .czi-lad b').textContent, lad: document.querySelector('#czBox .czi-lad').textContent, stage: document.querySelector('#czBox .czi-stage').textContent, turn: document.querySelector('#czBox .czi-turn').textContent }));
|
|
93
|
-
ok('I3 the chip and the meta are the record\'s', head.chip === 'At risk' && /warn/.test(head.tone) && head.meta === 'Onboarding · Dara · planned finish 30 Oct · stage derived by the workflow engine', JSON.stringify(head));
|
|
94
|
-
// premium-agreed-design I1: the header card's eight-step ladder, Deliver and Evaluate as milestones; Build is step 5
|
|
95
|
-
ok('I1 the header card shows the eight-step ladder with two milestones, the current step and the next', head.segs === 'done|done|done|done|now|ms||ms' && head.cur === 'Build' && /Prioritize/.test(head.lad) && /Deliver/.test(head.lad) && head.stage === '5 of 8 · Build' && head.turn === 'Your turn', JSON.stringify(head));
|
|
96
90
|
{
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
ok('I1 the
|
|
100
|
-
await
|
|
101
|
-
const fold = await p.evaluate(() => ({ items: document.querySelectorAll('#czBox .czi-it').length, sum: (document.querySelector('#czBox .czi-fold') || {}).textContent, exp: document.querySelector('#czBox [data-czfold]').getAttribute('aria-expanded') }));
|
|
102
|
-
ok('I1 the card folds to one line and opens again', fold.items === 0 && /To reach Deliver/.test(fold.sum) && /1 of 4 done · 2 for you, in Jira/.test(fold.sum) && fold.exp === 'false', JSON.stringify(fold));
|
|
103
|
-
await p.click('#czBox [data-czfold]');
|
|
104
|
-
ok('I1 opened again it lists the items', await p.evaluate(() => document.querySelectorAll('#czBox .czi-it').length === 4));
|
|
105
|
-
await p.click('#czBox [data-czdone]');
|
|
106
|
-
ok('I1 the done items open from their summary row', await p.evaluate(() => document.querySelector('#czBox [data-czdone]').getAttribute('aria-expanded') === 'true' && [...document.querySelectorAll('#czBox .czi-it.done')].some((e) => e.textContent.replace('✓', '').trim() === 'PRD and rubric written')));
|
|
107
|
-
await p.click('#czBox [data-czdone]');
|
|
108
|
-
const nC = A.posts.length; await p.click('#czBox [data-czcta]');
|
|
109
|
-
ok('I1 the CTA asks the read-only agent about the step that waits on you', await until(() => A.posts.length > nC && A.posts[A.posts.length - 1].path === '/api/briefing-premium/ask' && A.posts[A.posts.length - 1].body.key === 'init:self-serve-v2'), JSON.stringify(A.posts.slice(-1)));
|
|
110
|
-
await p.keyboard.press('Escape'); await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on')));
|
|
91
|
+
const R = await open({ url: '/premium-initiative.html?id=self-serve-v2&ws=w1&board=w1' });
|
|
92
|
+
const u = new URL(R.page.url());
|
|
93
|
+
ok('I1 the old initiative link lands on Home with this initiative, its workspace and board kept', R.up && u.pathname === '/premium.html' && u.searchParams.get('ini') === 'self-serve-v2' && u.searchParams.get('ws') === 'w1' && u.searchParams.get('board') === 'w1', R.page.url());
|
|
94
|
+
await R.ctx.close();
|
|
111
95
|
}
|
|
96
|
+
ok('I1 the console is not linked from Home', await p.evaluate(() => ![...document.querySelectorAll('a[href]')].some((a) => /console(\.html)?/.test(a.getAttribute('href')))));
|
|
97
|
+
await p.click('.hm-card .hm-sw[data-hm-switch]');
|
|
98
|
+
const sw = await until(() => p.evaluate(() => { const m = document.querySelector('#hmMenu'); return m && !m.hidden ? [...m.querySelectorAll('[data-hm-mi] b')].map((b) => b.textContent) : null; }));
|
|
99
|
+
ok('I1 the switcher lists Home, the product and the board\'s initiatives', !!sw && sw[0] === 'Home' && ['Self-serve onboarding v2', 'Partner API rate limits', 'Usage-based billing'].every((t) => sw.includes(t)), JSON.stringify(sw));
|
|
100
|
+
await p.click('#hmMenu [data-hm-mi]:has(b:text-is("Partner API rate limits"))');
|
|
101
|
+
{ const u = new URL(p.url()); ok('I1 choosing an initiative opens its layout on the same board', await until(() => p.evaluate(() => new URLSearchParams(location.search).get('ini') === 'partner-rate-limits')) && u.searchParams.get('ws') === 'w1' && u.searchParams.get('board') === 'w1', p.url()); }
|
|
102
|
+
await p.click('.hm-card .hm-sw[data-hm-switch]'); await until(() => p.evaluate(() => !document.querySelector('#hmMenu').hidden));
|
|
103
|
+
await p.click('#hmMenu [data-hm-mi="0"]');
|
|
104
|
+
ok('I1 Home in the switcher leads back to all work', await until(() => p.evaluate(() => !new URLSearchParams(location.search).get('ini'))), p.url());
|
|
105
|
+
await p.goto(BASE + '/premium.html?ini=self-serve-v2&ws=w1&board=w1&theme=light'); await ready(p);
|
|
112
106
|
|
|
113
|
-
/*
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
ok('
|
|
118
|
-
ok('
|
|
119
|
-
ok('
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
await p.
|
|
125
|
-
|
|
126
|
-
const
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
107
|
+
/* I3 header: the card */
|
|
108
|
+
const card = await p.evaluate(() => { const c = document.querySelector('.hm-card'); const q = (s) => ((c.querySelector(s) || {}).textContent || '').replace(/\s+/g, ' ').trim();
|
|
109
|
+
return { kind: q('.hm-sw .k'), title: q('.hm-sw b'), turn: q('.hm-turn'), stage: q('.hm-br .st'), lad: q('.hm-lad'), cur: q('.hm-lad b'), bars: c.querySelectorAll('.hm-bars i').length, now: c.querySelectorAll('.hm-bars i.now').length, ckh: q('.hm-ckh'), items: [...c.querySelectorAll('.hm-it')].map((x) => x.textContent.replace(/\s+/g, ' ').trim()), then: q('.hm-then'), time: q('.hm-time'), cta: q('[data-hm-cta]') }; });
|
|
110
|
+
ok('I3 the card names the initiative, its lane and its anchor', card.title === 'Self-serve onboarding v2' && /^Feature · \S/.test(card.kind), JSON.stringify(card));
|
|
111
|
+
ok('I3 the card shows the stage the workflow engine derives, with the ladder\'s current step and one bar a step', /Build/.test(card.stage + card.cur) && card.bars === 8 && card.now === 1, JSON.stringify(card));
|
|
112
|
+
ok('I1 the card lists what finishes the step, says whose turn it is, and has one CTA', card.items.length > 0 && !!card.turn && !!card.cta && !/pull request|builder agent/i.test(card.items.join(' ')), JSON.stringify(card));
|
|
113
|
+
ok('I1 the card has the payoff line and the time in the stage when the record has them', (!card.then || /^Then:/.test(card.then)) && (card.then || card.time), JSON.stringify(card));
|
|
114
|
+
if (await p.evaluate(() => !!document.querySelector('.hm-card [data-hm-done]'))) {
|
|
115
|
+
await p.click('.hm-card [data-hm-done]');
|
|
116
|
+
ok('I1 the done items open from their summary row', await until(() => p.evaluate(() => document.querySelector('.hm-card [data-hm-done]').getAttribute('aria-expanded') === 'true')));
|
|
117
|
+
}
|
|
118
|
+
ok('I3 Deliver is a milestone: the ladder and the checklist title carry the ◆ mark before it (Agreed design AgInitAgents)', await p.evaluate(() => !!document.querySelector('.hm-card .hm-lad .nx .cz-ms') && !!document.querySelector('.hm-card .hm-ckh .cz-ms') && /To reach Deliver/.test(document.querySelector('.hm-card .hm-ckh').textContent)));
|
|
119
|
+
await p.click('.hm-card [data-hm-cfold]');
|
|
120
|
+
const fold = await until(() => p.evaluate(() => { const c = document.querySelector('.hm-card'), f = c.querySelector('[data-hm-cfold]'); return f && f.getAttribute('aria-expanded') === 'false' ? { sum: f.textContent.replace(/\s+/g, ' ').trim(), items: c.querySelectorAll('.hm-it').length, then: !!c.querySelector('.hm-then'), time: !!c.querySelector('.hm-time'), cta: !!c.querySelector('[data-hm-cta]') } : null; }));
|
|
121
|
+
ok('I3 the checklist folds to one line with its summary; Then and the time line hide, the CTA stays (AgInitSpec)', fold && /^To reach Deliver ?\d+ of \d+ done/.test(fold.sum) && fold.items === 0 && !fold.then && !fold.time && fold.cta, JSON.stringify(fold));
|
|
122
|
+
await p.click('.hm-card [data-hm-cfold]');
|
|
123
|
+
ok('I3 it unfolds again', await until(() => p.evaluate(() => document.querySelector('.hm-card [data-hm-cfold]').getAttribute('aria-expanded') === 'true' && document.querySelectorAll('.hm-card .hm-it').length > 0)));
|
|
124
|
+
ok('I1 the card wrote nothing on its own', writes(A).length === 0, JSON.stringify(writes(A)));
|
|
130
125
|
|
|
131
|
-
/*
|
|
132
|
-
ok('
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
await p.
|
|
137
|
-
const cols = await p.evaluate(() => [...document.querySelectorAll('#tkBody .isc')].map((c) => c.querySelector('.label').textContent.replace(/\s+/g, ' ').trim()));
|
|
138
|
-
ok('I6 By stage groups by the records\' states, shows an empty column as None and puts the requirements under "No result recorded"', cols.join('|') === 'To do 1|In progress 1|On hold 0|Done 1|No result recorded 3', cols.join('|'));
|
|
139
|
-
await p.click('#tkTabs [data-v="time"]');
|
|
140
|
-
const tl = await p.evaluate(() => ({ bars: document.querySelectorAll('#tkBody .tkt').length, title: (document.querySelector('#tkBody .tkt .tlt b') || {}).textContent, und: [...document.querySelectorAll('#tkBody .tkch b')].map((b) => b.textContent).join('|'), months: [...document.querySelectorAll('#tkBody .tlax i')].map((i) => i.textContent).join(), today: !!document.querySelector('#tkBody .tlax b'), legend: document.querySelectorAll('#tkBody .gleg span').length }));
|
|
141
|
-
ok('I6 the Timeline draws a bar for each task with both dates, lists the rest as "No dates set", and draws today', tl.bars === 1 && tl.title === 'UAT with five partners' && /Sandbox key step/.test(tl.und) && /A partner reaches a first call/.test(tl.und) && tl.today && tl.legend === 3 && /Oct/.test(tl.months), JSON.stringify(tl));
|
|
142
|
-
await p.click('#tkTabs [data-v="list"]');
|
|
143
|
-
await p.locator('#cIniTk .tkq').first().click(); await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(500);
|
|
144
|
-
const td = await p.evaluate(() => ({ title: document.querySelector('#dTitle').textContent, grid: [...document.querySelectorAll('#oMain .kv2 span')].map((s) => s.textContent).join('|'), ask: document.querySelector('#askF').hidden, seg: !!document.querySelector('#oMain .tkst') }));
|
|
145
|
-
ok('I6 a Jira task opens its record as a grid, read-only: no status control, and its own conversation (premium-popup-context P1)', td.title === 'Sandbox key step' && /Reference\|ONB-12\|Source\|Jira \(read-only\)/.test(td.grid) && td.ask === false && td.seg === false, JSON.stringify(td));
|
|
146
|
-
// popup context slice 3 (L2, L3): the stored lead comes first, with its time and reads, and Refresh asks the popup's own session
|
|
147
|
-
A.setThread({ ok: true, working: false, turns: [], lead: { text: 'ONB-12 waits on the sandbox key. Ask Sam for a date.', cites: ['Jira read 07:02'], at: new Date().toISOString() } });
|
|
148
|
-
await p.keyboard.press('Escape'); await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on')));
|
|
149
|
-
await p.locator('#cIniTk .tkq').first().click(); await until(() => p.evaluate(() => !!document.querySelector('#dlg.on #leadT .plead')), 6000);
|
|
150
|
-
const ld = await p.evaluate(() => { const s = document.querySelector('#dBody .stream'); return { first: s.firstElementChild && s.firstElementChild.id, text: document.querySelector('#leadT').textContent }; });
|
|
151
|
-
ok('I6 a task popup shows Claude\'s stored lead first, with when it was written and what it read (popup context L2)', ld.first === 'leadT' && /waits on the sandbox key/.test(ld.text) && /Lead · written \d\d:\d\d · from Jira read 07:02/.test(ld.text), JSON.stringify(ld));
|
|
152
|
-
{ const nA = A.posts.length; await p.click('#leadT [data-lead="refresh"]');
|
|
153
|
-
ok('I6 Refresh asks the popup\'s own session to write the lead again and save it with pmos lead put (popup context L3)', await until(() => A.posts.slice(nA).some((x) => x.path === '/api/briefing-premium/ask' && /^pop:task:/.test(x.body.key) && x.body.text.includes('pmos lead put --key ' + x.body.key))), JSON.stringify(A.posts.slice(nA))); }
|
|
154
|
-
A.setThread({ ok: true, working: false, turns: [] });
|
|
155
|
-
await p.keyboard.press('Escape'); await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on')));
|
|
156
|
-
/* a PMOS task: its status can be changed */
|
|
157
|
-
A.set({ status: 200, body: { ok: true, item: {} } });
|
|
158
|
-
await p.locator('#cIniTk .tkq', { hasText: 'UAT with five partners' }).click(); await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(500);
|
|
159
|
-
ok('I6 a PMOS task offers the board\'s four states, with its own marked', await p.evaluate(() => [...document.querySelectorAll('#oMain [data-tks]')].map((b) => b.textContent + (b.getAttribute('aria-pressed') === 'true' ? '*' : '')).join('|')) === 'To do*|In progress|In review|Done');
|
|
160
|
-
await p.click('#oMain [data-tks="In progress"]');
|
|
161
|
-
ok('I10 a status change posts the board, the task and the state to the board\'s own route, and nothing else', await until(() => A.posts.some((x) => x.path === '/api/boards/tasks/state' && x.body.ws === 'w1' && x.body.board === 'w1' && x.body.task === 't1' && x.body.state === 'In progress' && Object.keys(x.body).sort().join() === 'board,state,task,ws')));
|
|
162
|
-
await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on')));
|
|
163
|
-
/* add a task */
|
|
164
|
-
await p.click('[data-tkadd]'); await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(400);
|
|
165
|
-
ok('I6 Add a task opens a form with common tasks, a title, an owner and optional dates, and says what empty dates mean', await p.evaluate(() => document.querySelectorAll('#oMain .chq button').length === 6 && !!document.querySelector('#atT') && !!document.querySelector('#atO') && !!document.querySelector('#atF') && !!document.querySelector('#atD') && /from tomorrow, for a week/.test(document.querySelector('#oMain').textContent)));
|
|
166
|
-
await p.click('#atGo'); ok('I6 an empty title is refused before any post', /Give the task a title/.test(await txt('#atM')) && !A.posts.some((x) => x.path === '/api/boards/tasks/add'));
|
|
167
|
-
await p.fill('#atT', 'UAT'); await p.fill('#atF', '2026-11-05'); await p.click('#atGo'); ok('I6 a start without a due date is refused', /Add a due date too/.test(await txt('#atM')));
|
|
168
|
-
await p.fill('#atD', '2026-11-01'); await p.click('#atGo'); ok('I6 a due date before the start is refused', /due date is before the start/.test(await txt('#atM')) && !A.posts.some((x) => x.path === '/api/boards/tasks/add'));
|
|
169
|
-
await p.click('#oMain [data-pre="1"]'); ok('I6 a common task fills the title', await p.inputValue('#atT') === 'Release plan');
|
|
170
|
-
await p.fill('#atF', ''); await p.fill('#atD', '');
|
|
171
|
-
A.set({ status: 400, body: { ok: false, error: 'no initiative self-serve-v2 on this board' } }); await p.click('#atGo');
|
|
172
|
-
ok('I6 a refusal shows the route\'s reason, keeps the form and turns the button back on', await until(() => p.evaluate(() => /no initiative self-serve-v2 on this board/.test(document.querySelector('#atM').textContent) && !document.querySelector('#atGo').disabled)));
|
|
173
|
-
A.set({ status: 200, body: { ok: true, item: {} } }); await p.fill('#atO', 'Dara'); await p.fill('#atF', '2026-11-01'); await p.fill('#atD', '2026-11-05'); await p.click('#atGo');
|
|
174
|
-
ok('I10 Add task posts the workspace, the board, this initiative, the title, the owner and the dates to the board\'s own route', await until(() => A.posts.some((x) => x.path === '/api/boards/tasks/add' && x.body.ws === 'w1' && x.body.board === 'w1' && x.body.initiative === 'self-serve-v2' && x.body.title === 'Release plan' && x.body.owner === 'Dara' && x.body.start === '2026-11-01' && x.body.due === '2026-11-05' && Object.keys(x.body).sort().join() === 'board,due,initiative,owner,start,title,ws')));
|
|
175
|
-
const mint0 = await T.nonce(BASE);
|
|
176
|
-
ok('I10 both task presses carried the launch nonce and no writer field', !!mint0 && A.posts.filter((x) => /^\/api\/boards\/tasks\//.test(x.path)).every((x) => x.headers['x-pmos-nonce'] === mint0 && !['by', 'via', 'at', 'actor', 'pm', 'nonce'].some((k) => k in x.body)));
|
|
177
|
-
await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on')));
|
|
178
|
-
ok('I6 Add a document is the one button of the Core documents card that adds (its own suite is briefing-premium-adddoc-test.js)', await p.evaluate(() => document.querySelectorAll('[data-adddoc]').length === 1 && /Add a document/.test(document.querySelector('#cIniDoc .ch').textContent)));
|
|
126
|
+
/* I7 documents: the list's Core documents group (in place of the Files group) shows the ones that need a look and opens them all in the Viewer (InDocs) */
|
|
127
|
+
ok('I7 the list holds Core documents with its count and an All documents line; the Files group is gone', await until(() => p.evaluate(() => { const g = document.querySelector('#hmList section[data-hi="docs"]'); const f = document.querySelector('#hmList section.hm-g[aria-label="Files"]'); return !!g && /Core documents/.test(g.textContent) && !!g.querySelector('[data-hi-open="docs"]') && (!f || f.hidden); })));
|
|
128
|
+
await p.click('#hmList [data-hi-open="docs"]');
|
|
129
|
+
await until(() => p.evaluate((v) => !!document.querySelector(v + ' [data-ov-open="planning/prd/self-serve-v2-prd.md"]'), V), 15000);
|
|
130
|
+
await p.click(`${V} [data-ov-open="planning/prd/self-serve-v2-prd.md"]`);
|
|
131
|
+
ok('I7 a file opens as its page in the Viewer, not a dialog', await until(() => p.evaluate((v) => !!document.querySelector(v + ' .obody.vw[data-vw="doc:planning/prd/self-serve-v2-prd.md"]') && !(document.querySelector('#dlg') && !!document.querySelector('#dlg.on')), V), 15000));
|
|
179
132
|
|
|
180
|
-
/*
|
|
181
|
-
ok('
|
|
182
|
-
|
|
183
|
-
await p
|
|
184
|
-
|
|
185
|
-
await
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
133
|
+
/* I4 the Overview */
|
|
134
|
+
ok('I4 the card\'s Overview press opens the initiative in the Viewer on its Tasks, with Documents and Stage beside it, and no Waiting for design marker', await overview(p, null) && await p.evaluate((v) => /Tasks/.test(document.querySelector('#czViewer .cz-vw-kind').textContent) && [...document.querySelectorAll(v + ' [data-hi-view]')].map((b) => b.textContent).join() === 'Tasks,Documents,Stage' && !document.querySelector(v + ' .hx-wait'), V));
|
|
135
|
+
const tk = await p.evaluate((v) => { const o = document.querySelector(v); return { tasks: [...o.querySelectorAll('[data-ov-tkrow]')].map((r) => r.dataset.ovTkrow).sort(), checks: [...o.querySelectorAll('button[data-hi-chk]')].map((b) => b.dataset.hiChk).sort() }; }, V);
|
|
136
|
+
await show(p, 'stage');
|
|
137
|
+
const st = await p.evaluate((v) => { const o = document.querySelector(v); return { moves: [...o.querySelectorAll('[data-ov-move]')].map((b) => b.dataset.ovMove), cur: (o.querySelector('[data-ov-move][aria-pressed="true"]') || {}).textContent, life: [...o.querySelectorAll('[data-ov-life]')].map((b) => b.dataset.ovLife) }; }, V);
|
|
138
|
+
await show(p, 'docs');
|
|
139
|
+
const ov = await p.evaluate((v) => { const o = document.querySelector(v); return { docs: [...o.querySelectorAll('[data-ov-doc]')].map((d) => d.dataset.ovDoc).sort(), draft: [...o.querySelectorAll('[data-ov-draft]')].map((b) => b.dataset.ovDraft).sort(), drafting: [...o.querySelectorAll('[data-ov-doc]')].filter((d) => /Drafting/.test(d.textContent)).map((d) => d.dataset.ovDoc), dread: [...o.querySelectorAll('[data-ov-dread]')].map((b) => b.dataset.ovDread), sum: (o.querySelector('[data-ov-dsum]') || {}).textContent || '' }; }, V);
|
|
140
|
+
const M = mk();
|
|
141
|
+
ok('I4 the Stage view lists the board\'s stages with the current one pressed, and the lifecycle presses', JSON.stringify(st.moves) === JSON.stringify(M.acts.stages) && st.cur === 'Build' && st.life.join() === 'on-hold,cancelled', JSON.stringify(st));
|
|
142
|
+
ok('I6 the tasks are the record\'s, and only a PMOS task has a check box it can change', JSON.stringify(tk.tasks) === JSON.stringify(M.tasks.rows.map((t) => t.key).sort()) && JSON.stringify(tk.checks) === JSON.stringify(M.tasks.rows.filter((t) => t.pmos && t.uid).map((t) => t.key).sort()), JSON.stringify(tk));
|
|
143
|
+
ok('I7 the core documents are the non-technical ones, with the engine\'s summary', JSON.stringify(ov.docs) === JSON.stringify(M.docs.rows.filter((d) => !d.tech).map((d) => d.key).sort()) && ov.sum === M.docs.cap, JSON.stringify(ov));
|
|
144
|
+
ok('I7 a document not started offers Draft it; a running one says Drafting and has no press; a draft offers Read', ov.draft.join() === 'problem,research' && ov.drafting.join() === 'launch' && ov.dread.length === M.docs.rows.filter((d) => !d.tech && d.st === 'draft' && d.path && d.slot).length, JSON.stringify(ov));
|
|
189
145
|
|
|
190
|
-
/* I10
|
|
191
|
-
A.set({ status: 200, body: { ok: true, run: 'r1' } });
|
|
192
|
-
await p.locator('#dmList [data-draft="problem"]').click();
|
|
193
|
-
ok('I10 Draft it posts the workspace, the initiative scope and the key and nothing else, and says what happens', await until(() => A.posts.some((x) => x.path === '/api/core-docs/draft' && x.body.ws === 'w1' && x.body.scope === 'initiative:self-serve-v2' && x.body.key === 'problem' && Object.keys(x.body).sort().join() === 'key,scope,ws')) && await until(() => p.evaluate(() => /drafting “Problem statement”/.test(document.querySelector('#toast').textContent))));
|
|
146
|
+
/* I10 presses */
|
|
194
147
|
const mint = await T.nonce(BASE);
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
await p.
|
|
198
|
-
|
|
199
|
-
ok('I10
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
await p.
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
await p.
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
await p.
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
await
|
|
222
|
-
ok('
|
|
223
|
-
await
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
await
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
await p.click(
|
|
231
|
-
ok('
|
|
232
|
-
|
|
233
|
-
ok('
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
ok('I8 linking posts the path, the tool and the address, and the status line then names the copy', A.posts.some((x) => x.path === '/api/docs/link' && x.body.kind === 'google' && x.body.path === 'planning/prd/self-serve-v2-prd.md' && x.body.ws === 'w1' && /docs\.google\.com/.test(x.body.target)));
|
|
237
|
-
await p.click('[data-ds="cpcheck"]');
|
|
238
|
-
ok('I8 Check now posts the workspace only and the button reads Checking', A.posts.some((x) => x.path === '/api/docs/check' && Object.keys(x.body).join() === 'ws') && await until(() => p.evaluate(() => /Checking/.test(document.querySelector('[data-ds="cpcheck"]').textContent))));
|
|
239
|
-
await p.click('#oMain [data-ds="cp"]');
|
|
240
|
-
ok('I8 the health check posts the path and the workspace only', A.posts.some((x) => x.path === '/api/doc-health/check' && Object.keys(x.body).sort().join() === 'path,ws' && x.body.ws === 'w1'));
|
|
241
|
-
ok('I8 the sheet wrote nothing: no edit, propose, accept, reject, why, mark or ask post went out', !A.posts.slice(nPost0).some((x) => /doc-sheet/.test(x.path)) && !A.posts.some((x) => /^\/api\/doc-sheet\/(edit|propose|accept|reject|why|mark-current|ask)/.test(x.path)));
|
|
242
|
-
ok('I8 the sheet says the file changes only on Save or Accept', /only when you press Save or Accept/.test(await txt('#oMain .xn')));
|
|
243
|
-
A.setThread({ ok: true, working: false, turns: [] });
|
|
244
|
-
await p.fill('#askIn', 'What is missing?'); const nA = A.posts.length; await p.press('#askIn', 'Enter');
|
|
245
|
-
ok('I8 a question posts the document key and the text', await until(() => A.posts.length > nA && A.posts[A.posts.length - 1].path === '/api/briefing-premium/ask' && A.posts[A.posts.length - 1].body.key === 'doc:self-serve-v2:prd' && A.posts[A.posts.length - 1].body.text === 'What is missing?'));
|
|
246
|
-
await p.keyboard.press('Escape'); await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on')));
|
|
247
|
-
await p.fill('#dmQ', ''); await p.click('#dmF [data-dmf="all"]');
|
|
248
|
-
ok('I8 every document row opens, including one with no file', await p.evaluate(() => [...document.querySelectorAll('#dmList .dmr')].every((r) => !!r.querySelector('.dmo[data-doc]'))));
|
|
249
|
-
await p.click('#dmList .dmo[data-doc="problem"]'); await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(400);
|
|
250
|
-
{ const ab = await p.evaluate(() => ({ title: document.querySelector('#dTitle').textContent, body: document.querySelector('#oMain').textContent, draft: !!document.querySelector('#abDraft'), ask: document.querySelector('#askF').hidden }));
|
|
251
|
-
ok('I8 a document with no file says what it is for, who writes it and offers Draft it', ab.title === 'Problem statement' && /Who writes it/.test(ab.body) && ab.draft && ab.ask === false, JSON.stringify(ab)); }
|
|
252
|
-
const nD = A.posts.length; A.set({ status: 200, body: { ok: true, run: 'r1' } }); await p.click('#abDraft');
|
|
253
|
-
ok('I8 Draft it in that popup posts the draft route and closes the popup', await until(() => A.posts.length > nD && A.posts[A.posts.length - 1].path === '/api/core-docs/draft' && A.posts[A.posts.length - 1].body.key === 'problem') && await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on'))));
|
|
254
|
-
await p.click('#dmList .dmo[data-doc="research"]'); await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on') && document.querySelector('#dTitle').textContent === 'Research notes')); await sleep(400);
|
|
255
|
-
{ const rs = await p.evaluate(() => ({ say: document.querySelector('#dBody .stream').textContent, prd: (document.querySelector('#oMain .dprd') || {}).textContent || '', body: document.querySelector('#oMain').textContent, first: !!document.querySelector('#oMain .dprd') && document.querySelector('#oMain .dprd').compareDocumentPosition(document.querySelector('#oMain .kv2')) === Node.DOCUMENT_POSITION_FOLLOWING }));
|
|
256
|
-
ok('I8 a derived document with no file shows the PRD section it comes from, before its details, and the first line says so', /The PRD’s “Evidence” section covers it/.test(rs.say) && /Five of eight trial teams stalled/.test(rs.prd) && /• Support tickets doubled/.test(rs.prd) && /From the PRD: Evidence/.test(rs.body) && /planning\/prd\/self-serve-v2-prd\.md § Evidence/.test(rs.body) && !/nothing to read here/.test(rs.body) && rs.first, JSON.stringify(rs)); }
|
|
257
|
-
await p.keyboard.press('Escape'); await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on')));
|
|
148
|
+
const settle = async (fn) => { const c = A.calls(); await fn(); await until(() => A.calls() > c, 10000); await sleep(500); }; // a press that lands reads the initiative again and draws the Overview again
|
|
149
|
+
await show(p, 'stage');
|
|
150
|
+
await settle(() => p.click(`${V} [data-ov-move="Deliver"]`));
|
|
151
|
+
const mv = await until(() => A.posts.find((x) => x.path === '/api/boards/move'));
|
|
152
|
+
ok('I10 a stage press posts the board, the initiative and the stage to the move route', mv && mv.body.ws === 'w1' && mv.body.board === 'w1' && mv.body.id === 'self-serve-v2' && mv.body.to === 'Deliver', JSON.stringify(mv && mv.body));
|
|
153
|
+
await until(() => p.evaluate((v) => !!document.querySelector(v + ' [data-ov-move]'), V));
|
|
154
|
+
await p.click(`${V} [data-ov-life="on-hold"]`);
|
|
155
|
+
ok('I10 a lifecycle press asks its reason inline before it posts', await until(() => p.evaluate((v) => !!document.querySelector(v + ' #ovWhy'), V)) && !A.posts.some((x) => x.path === '/api/lifecycle'));
|
|
156
|
+
await p.fill(`${V} #ovWhy`, 'x'); await p.click(`${V} [data-ov-life-go]`);
|
|
157
|
+
ok('I10 a reason too short is refused and nothing is posted', await until(async () => /Say why in a few words/.test(await txt(p, V + ' #ovMsg'))) && !A.posts.some((x) => x.path === '/api/lifecycle'));
|
|
158
|
+
await p.fill(`${V} #ovWhy`, 'Waiting on legal'); await settle(() => p.click(`${V} [data-ov-life-go]`));
|
|
159
|
+
const lf = await until(() => A.posts.find((x) => x.path === '/api/lifecycle'));
|
|
160
|
+
ok('I10 Record posts the state and the reason to the lifecycle route', lf && lf.body.initiative_id === 'self-serve-v2' && lf.body.state === 'on-hold' && lf.body.reason === 'Waiting on legal' && lf.body.ws === 'w1', JSON.stringify(lf && lf.body));
|
|
161
|
+
await show(p, 'tasks');
|
|
162
|
+
await until(() => p.evaluate((v) => !!document.querySelector(v + ' #ovTask'), V));
|
|
163
|
+
await p.click(`${V} [data-ov-add]`); await sleep(200);
|
|
164
|
+
ok('I6 Add with no title posts nothing', !A.posts.some((x) => x.path === '/api/boards/tasks/add'));
|
|
165
|
+
await p.fill(`${V} #ovTask`, 'Release plan'); await settle(() => p.click(`${V} [data-ov-add]`));
|
|
166
|
+
const ad = await until(() => A.posts.find((x) => x.path === '/api/boards/tasks/add'));
|
|
167
|
+
ok('I10 Add posts the workspace, the board, this initiative and the title to the board\'s own route', ad && ad.body.ws === 'w1' && ad.body.board === 'w1' && ad.body.initiative === 'self-serve-v2' && ad.body.title === 'Release plan', JSON.stringify(ad && ad.body));
|
|
168
|
+
// a PMOS task's status is in its row's menu (InTasks)
|
|
169
|
+
const pk = M.tasks.rows.find((t) => t.pmos && t.uid).key;
|
|
170
|
+
await until(() => p.evaluate((a) => !!document.querySelector(a[0] + ` [data-hi-tmore="${a[1]}"]`), [V, pk]));
|
|
171
|
+
await p.click(`${V} [data-hi-tmore="${pk}"]`);
|
|
172
|
+
await until(() => p.evaluate(() => !!document.querySelector('.hi-pop[role="menu"]')));
|
|
173
|
+
await settle(() => p.click('.hi-pop[role="menu"] [role="menuitemradio"]:has(span:text-is("In progress"))'));
|
|
174
|
+
const ts = await until(() => A.posts.find((x) => x.path === '/api/boards/tasks/state'));
|
|
175
|
+
ok('I10 a status change posts the board, the task and the state, and nothing else', ts && Object.keys(ts.body).sort().join() === 'board,state,task,ws' && ts.body.state === 'In progress', JSON.stringify(ts && ts.body));
|
|
176
|
+
await show(p, 'docs');
|
|
177
|
+
await until(() => p.evaluate((v) => !!document.querySelector(v + ' [data-ov-draft="problem"]'), V));
|
|
178
|
+
await settle(() => p.click(`${V} [data-ov-draft="problem"]`));
|
|
179
|
+
const dr = await until(() => A.posts.find((x) => x.path === '/api/core-docs/draft'));
|
|
180
|
+
ok('I10 Draft it posts the workspace, the initiative scope and the key and nothing else', dr && Object.keys(dr.body).sort().join() === 'key,scope,ws' && dr.body.scope === 'initiative:self-serve-v2' && dr.body.key === 'problem', JSON.stringify(dr && dr.body));
|
|
181
|
+
A.set({ status: 409, body: { ok: false, error: 'PMOS is already drafting this document.' } });
|
|
182
|
+
await until(() => p.evaluate((v) => !!document.querySelector(v + ' [data-ov-draft="research"]'), V));
|
|
183
|
+
await p.click(`${V} [data-ov-draft="research"]`);
|
|
184
|
+
ok('I10 a refused press shows the route\'s reason in the Overview', await until(async () => /already drafting/.test(await txt(p, V + ' #ovMsg'))));
|
|
185
|
+
A.set({ status: 200, body: { ok: true } });
|
|
186
|
+
ok('I10 every press carried the launch nonce and no writer field', !!mint && writes(A).length >= 5 && writes(A).every((x) => x.headers['x-pmos-nonce'] === mint && !['by', 'via', 'at', 'actor', 'pm', 'nonce'].some((k) => k in x.body)), JSON.stringify(writes(A).map((x) => x.path)));
|
|
187
|
+
ok('I10 the Overview posts only to the move, lifecycle, task and draft routes', A.posts.filter((x) => /^\/api\/(boards|lifecycle|core-docs)/.test(x.path)).every((x) => WRITES.test(x.path)));
|
|
188
|
+
ok('I1 the old dialog never opened', await p.evaluate(() => { const d = document.querySelector('#dlg'); return !d || !d.classList.contains('on'); }));
|
|
258
189
|
ok('0 no page error', A.errors.length === 0, A.errors.join(' | '));
|
|
259
190
|
await A.ctx.close();
|
|
260
191
|
|
|
261
|
-
/*
|
|
262
|
-
{
|
|
263
|
-
const B = await open();
|
|
264
|
-
await B.page.unroute('**/api/doc-sheet/**'); await B.page.route('**/api/doc-sheet/**', (r) => r.fulfill({ status: 404, contentType: 'application/json', body: JSON.stringify({ ok: false, error: 'the file is not in this repository' }) }));
|
|
265
|
-
await B.page.locator('#dmList .dmo[data-doc="prd"]').click();
|
|
266
|
-
ok('I8 a file that cannot be read says why and shows no text', await until(() => B.page.evaluate(() => /the file is not in this repository/.test(document.querySelector('#oMain').textContent))));
|
|
267
|
-
await B.ctx.close();
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
/* I2 reading and failure */
|
|
192
|
+
/* I2 reading and honest states */
|
|
271
193
|
{
|
|
272
194
|
let n = 0;
|
|
273
|
-
const
|
|
274
|
-
await
|
|
275
|
-
await
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
await
|
|
279
|
-
|
|
280
|
-
ok('I2
|
|
195
|
+
const R = await open({ answers: (c) => { n = c; return c <= 2 ? { status: 202, body: { ok: true, state: 'reading' } } : { status: 200, body: { ok: true, state: 'ready', model: mk(), as_of: Date.now() } }; } });
|
|
196
|
+
await overview(R.page);
|
|
197
|
+
ok('I2 while the initiative is read the Overview says so, then draws when the read ends', await until(() => R.page.evaluate((v) => !!document.querySelector(v + ' [data-ov-move]'), V), 20000) && n >= 3, String(n));
|
|
198
|
+
await R.ctx.close();
|
|
199
|
+
const E = await open({ answers: () => ({ status: 500, body: { ok: false, state: 'error', error: 'the board could not be read' } }) });
|
|
200
|
+
await overview(E.page);
|
|
201
|
+
ok('I2 a failed read says so in the Overview and draws no stage or task', await until(() => E.page.evaluate((v) => { const o = document.querySelector(v); return !!o && /could not be read/.test(o.textContent) && !o.querySelector('[data-ov-move], [data-ov-tkrow]'); }, V), 60000));
|
|
202
|
+
ok('I2 no page error on a failed read', E.errors.length === 0, E.errors.join(' | '));
|
|
281
203
|
await E.ctx.close();
|
|
282
|
-
const N = await open({ answers: () => ({ status: 404, body: { ok: false, state: 'error', error: 'nope is not an initiative on a board' } }), qs: '?id=nope' });
|
|
283
|
-
ok('I2 an initiative that is not on a board says so and does not retry', await N.page.evaluate(() => /nope is not an initiative on a board/.test(document.querySelector('#iMain').textContent)) && N.calls() === 1);
|
|
284
|
-
await N.ctx.close();
|
|
285
|
-
const X = await open({ qs: '?x=1', answers: () => ({ status: 400, body: { ok: false, state: 'error', error: 'id must name an initiative' } }) });
|
|
286
|
-
ok('I2 no initiative named says so', await X.page.evaluate(() => /needs an initiative/.test(document.querySelector('#iMain').textContent)));
|
|
287
|
-
await X.ctx.close();
|
|
288
204
|
}
|
|
289
205
|
|
|
290
|
-
/*
|
|
206
|
+
/* I12 floors at 390 */
|
|
291
207
|
{
|
|
292
|
-
const
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
{
|
|
299
|
-
const many = Array.from({ length: 25 }, (_, n) => ({ uid: 'm' + n, key: 'M-' + n, kind: 'Task', src: 'jira', title: 'Task ' + n, status: n % 3 ? 'To do' : 'Done', blocked: false, owner: null, ini: 'self-serve-v2', start: null, end: null }));
|
|
300
|
-
const D = await open({ model: mk({ items: many }) });
|
|
301
|
-
const rows = () => D.page.evaluate(() => document.querySelectorAll('#tkBody .tkq').length);
|
|
302
|
-
ok('I6 the List shows ten tasks and says where it is', await rows() === 10 && /1–10 of 28/.test(await D.page.evaluate(() => document.querySelector('.tkpg').textContent)));
|
|
303
|
-
await D.page.click('[data-tkpg="1"]'); await D.page.click('[data-tkpg="1"]');
|
|
304
|
-
ok('I6 Next walks to the last page, which holds the rest, and Next is then off', await rows() === 8 && await D.page.evaluate(() => document.querySelector('[data-tkpg="1"]').disabled));
|
|
305
|
-
await D.page.click('#tkTabs [data-v="stage"]');
|
|
306
|
-
ok('I6 By stage caps a column and Show more opens it', await D.page.evaluate(() => document.querySelectorAll('#tkBody .isc:nth-child(1) .tkc').length) <= 6 && (await D.page.locator('[data-tkmore]').count()) > 0);
|
|
307
|
-
await D.page.locator('[data-tkmore]').first().click();
|
|
308
|
-
ok('I6 Show more lists the whole column', await D.page.evaluate(() => document.querySelectorAll('#tkBody .tkc').length) >= 25);
|
|
309
|
-
await D.page.click('#tkTabs [data-v="time"]');
|
|
310
|
-
ok('I6 the Timeline keeps working and is paged too', /of 28/.test(await D.page.evaluate(() => document.querySelector('.tkpg').textContent)));
|
|
311
|
-
await D.ctx.close();
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
/* I3 degraded: nothing invented */
|
|
315
|
-
{
|
|
316
|
-
const D = await open({ model: mk({ row: Object.assign({}, F.ROW, { owner: null, end: null, status: null }), sheet: null, ladder: null, items: [], docs: null }) });
|
|
317
|
-
const d = await D.page.evaluate(() => ({ chip: !!document.querySelector('.ihead .chp'), meta: document.querySelector('.ihm').textContent, ov: document.querySelector('#cIniOv').textContent, chk: !!document.querySelector('#cIniChk'), tk: document.querySelector('#cIniTk').textContent, docs: document.querySelector('#cIniDoc').textContent }));
|
|
318
|
-
ok('I3 with no status, owner, finish, sheet, items or documents the page says so and draws none of them', !d.chip && d.meta === 'Onboarding · stage derived by the workflow engine' && /could not be read, so the next step is not shown/.test(d.ov) && !d.chk && /no PRD requirement list and no tracker item/.test(d.tk) && /could not be read, so none is shown/.test(d.docs), JSON.stringify(d));
|
|
319
|
-
await D.ctx.close();
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
/* I12 floors */
|
|
323
|
-
for (const [w, h] of [[1280, 900], [390, 844]]) {
|
|
324
|
-
const R = await open({ w, h });
|
|
325
|
-
const f = await R.page.evaluate(() => { const bad = []; for (const e of document.querySelectorAll('button,a,[role=button],input')) { if (e.closest('[hidden],[inert]')) continue; const r = (e.tagName === 'INPUT' && e.closest('label') ? e.closest('label') : e).getBoundingClientRect(); if (r.width && r.height && (r.height < 32 || r.width < 32) && !e.closest('.seg,.dprog')) bad.push((e.id || e.className || e.tagName) + ' ' + Math.round(r.width) + 'x' + Math.round(r.height)); } return { sx: document.documentElement.scrollWidth - innerWidth, small: bad.slice(0, 6) }; });
|
|
326
|
-
ok(`I12 no sideways scroll and no tiny target at ${w} px`, f.sx <= 0 && f.small.length === 0, JSON.stringify(f));
|
|
327
|
-
if (w === 390) {
|
|
328
|
-
await R.page.locator('#dmList .dmo[data-doc="prd"]').click(); await until(() => R.page.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(700);
|
|
329
|
-
const g = await R.page.evaluate(() => { const r = document.querySelector('#dlg').getBoundingClientRect(); return { l: Math.round(r.left), w: Math.round(r.width), vw: innerWidth }; });
|
|
330
|
-
ok('I12 the sheet is full width on a phone', g.l <= 1 && g.w >= g.vw - 2, JSON.stringify(g));
|
|
208
|
+
const N = await open({ w: 390, h: 844 });
|
|
209
|
+
await overview(N.page, null);
|
|
210
|
+
const fls = [];
|
|
211
|
+
for (const view of ['tasks', 'docs', 'stage']) {
|
|
212
|
+
await show(N.page, view);
|
|
213
|
+
fls.push(await N.page.evaluate((a) => { const o = document.querySelector(a[0]); const small = [...o.querySelectorAll('button, select, input')].filter((b) => b.offsetParent && b.getBoundingClientRect().height < 44).map((b) => b.textContent.trim().slice(0, 24) || b.id || b.getAttribute('aria-label') || b.tagName); return { view: a[1], over: document.documentElement.scrollWidth - innerWidth, small }; }, [V, view]));
|
|
331
214
|
}
|
|
332
|
-
|
|
215
|
+
ok('I12 at 390 px the Overview\'s Tasks, Documents and Stage have no sideways scroll and every target is 44 px', fls.every((fl) => fl.over <= 0 && fl.small.length === 0), JSON.stringify(fls));
|
|
216
|
+
ok('I12 no page error at 390 px', N.errors.length === 0, N.errors.join(' | '));
|
|
217
|
+
await N.ctx.close();
|
|
333
218
|
}
|
|
334
219
|
|
|
335
220
|
/* the real routes against this repository */
|
|
@@ -345,27 +230,27 @@ const HEALTH = { ok: true, path: 'planning/prd/self-serve-v2-prd.md', health: {
|
|
|
345
230
|
const bad = await fetch(BASE + '/api/initiative-premium?id=../etc/passwd'); ok('I1 an id that is not an id is refused', bad.status === 400);
|
|
346
231
|
const post = await fetch(BASE + '/api/initiative-premium?id=x', { method: 'POST' }); ok('I10 the route answers GET only', post.status === 405);
|
|
347
232
|
}
|
|
348
|
-
|
|
349
|
-
|
|
233
|
+
|
|
234
|
+
/* I12 fidelity: the Agreed design (premium-agreed-design, Inside one initiative): Nunito, the cozy card, the CTA in the solid colour, the floating
|
|
235
|
+
* menu. The colours are read from the page's own tokens, so each theme is checked against itself. */
|
|
350
236
|
for (const [w, h] of [[1440, 900], [390, 844]]) for (const th of ['light', 'dark']) {
|
|
351
|
-
const R = await open({ w, h, theme: th });
|
|
237
|
+
const R = await open({ w, h, theme: th });
|
|
352
238
|
const g = await R.page.evaluate(() => {
|
|
353
|
-
const
|
|
354
|
-
|
|
355
|
-
|
|
239
|
+
const tok = (v) => { const x = document.createElement('i'); x.style.setProperty('background-color', 'var(' + v + ')'); document.body.appendChild(x); const c = getComputedStyle(x).backgroundColor; x.remove(); return c; };
|
|
240
|
+
const cs = (s) => { const e = document.querySelector(s); return e ? getComputedStyle(e) : null; };
|
|
241
|
+
const fab = document.querySelector('#czFab'), fr = fab && fab.getBoundingClientRect();
|
|
242
|
+
const c = document.querySelector('.hm-card').getBoundingClientRect();
|
|
243
|
+
return { font: cs('body').fontFamily, cta: cs('.hm-card [data-hm-cta]').backgroundColor, ctaAlt: document.querySelector('.hm-card [data-hm-cta]').classList.contains('alt'), solid: tok('--cz-solid'), blue: tok('--cz-blue'), well: tok('--cz-well'), card: tok('--cz-card'), box: cs('.hm-card .hm-box').backgroundColor, rad: parseFloat(cs('.hm-card .hm-box').borderTopLeftRadius), fab: fr ? [Math.round(fr.width), Math.round(fr.height)] : null, over: document.documentElement.scrollWidth - innerWidth, cardW: Math.round(c.width) };
|
|
356
244
|
});
|
|
357
|
-
const
|
|
245
|
+
const d = [];
|
|
358
246
|
if (!/^Nunito/.test(g.font)) d.push('font ' + g.font);
|
|
359
|
-
if (g.
|
|
360
|
-
if (g.
|
|
361
|
-
if (
|
|
362
|
-
if (g.
|
|
363
|
-
if (g.
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
if (g.top.t > (desk ? 40 : 16)) d.push('the header card does not start at the top ' + JSON.stringify(g.top));
|
|
367
|
-
if (g.h1 !== 'absolute') d.push('a visible page header ' + g.h1);
|
|
368
|
-
ok(`I12 the page follows the Agreed design at ${w} px, ${th}: Nunito, the cozy panel, the header card at the top, the blue CTA, the floating menu`, d.length === 0, d.join(' ; '));
|
|
247
|
+
if (!g.ctaAlt && ![g.solid, g.blue].includes(g.cta)) d.push('cta ' + g.cta + ' want ' + g.solid + ' or ' + g.blue);
|
|
248
|
+
if (![g.well, g.card].includes(g.box) && !/rgba/.test(g.box)) d.push('card box ' + g.box);
|
|
249
|
+
if (g.rad < 12) d.push('card radius ' + g.rad);
|
|
250
|
+
if (!g.fab || g.fab[0] !== 56 || g.fab[1] !== 56) d.push('fab ' + JSON.stringify(g.fab));
|
|
251
|
+
if (g.over > 0) d.push('sideways scroll ' + g.over);
|
|
252
|
+
ok(`I12 the initiative follows the Agreed design at ${w} px, ${th}: Nunito, the cozy card, the CTA, the floating menu`, d.length === 0, d.join(' ; '));
|
|
253
|
+
ok(`I12 no page error at ${w} px, ${th}`, R.errors.length === 0, R.errors.join(' | '));
|
|
369
254
|
await R.ctx.close();
|
|
370
255
|
}
|
|
371
256
|
return finish();
|