Skip to content

Autonomous development for real products. Governed agents build from specs you approve, follow the rules you set, and nothing merges until another agent proves it. Your decisions, judgement and taste are the bar that work must clear. Declare your vision and let agents build it.

test(view): follow scoped item anchors [N38,N26]

Corey Olson1c120eb7acb6
diff --git a/test/cockpit/activity.test.js b/test/cockpit/activity.test.js
index b00d35ae..ebdaf402 100644
--- a/test/cockpit/activity.test.js
+++ b/test/cockpit/activity.test.js
@@ -363,7 +363,7 @@ test('activity names the item each event moved [N26]', async () => {
const rows = page.show('activity').split('<div><time>').slice(1);
const about = rows.filter((row) => row.includes('data-go="item:1"'));
assert.equal(about.length, 2, 'the add and the claim');
- for (const row of about) assert.match(row, /type="button">#1<\/button> <span class="what">Greeting &lt;b&gt;bold&lt;\/b&gt;<\/span><\/div>/, 'the escaped title follows the link');
+ for (const row of about) assert.match(row, /data-go="item:1">#1<\/a> <span class="what">Greeting &lt;b&gt;bold&lt;\/b&gt;<\/span><\/div>/, 'the escaped title follows the link');
const joins = rows.filter((row) => /<\/b> join<\/div>/.test(row));
assert.ok(joins.length > 0 && joins.every((row) => !row.includes('class="what"')), 'an event about no item names none');
assert.match(await styleOf(view), /\.feed \.act \.what \{ flex: 1 1 auto; min-width: 0; overflow-wrap: break-word;/, 'activity titles wrap at words and permit an overflowing token to break');
diff --git a/test/cockpit/projects.test.js b/test/cockpit/projects.test.js
index eccd7e59..cb3a1063 100644
--- a/test/cockpit/projects.test.js
+++ b/test/cockpit/projects.test.js
@@ -96,27 +96,27 @@ test('projects group repos with combined needs and activity, while ungrouped and
assert.equal(page.element('tabs').hidden, true);
assert.match(page.show('group-needs'), /Core API/);
assert.match(page.show('group-needs'), /Web UI/);
- assert.match(page.show('group-needs'), /<b>Core API<\/b><code>G3<\/code><span>Should <button class="ref" data-root="[^"]+" data-go="item:1" title="Core target #1" type="button">#1<\/button> greet in French\?<\/span><button data-root="[^"]+" type="button"><em>answer in SPEC\.md →<\/em><\/button>/, "a question in one repo's spec");
- assert.match(page.show('group-needs'), /<b>Web UI<\/b><code>coordinator \(unknown\)<\/code><span>Ship <button class="ref" data-root="[^"]+" data-go="item:1" title="Target for #1" type="button">#1<\/button> today\?<\/span><button data-root="[^"]+" type="button"><em>decision, /, "and a decision in another's");
+ assert.match(page.show('group-needs'), /<b>Core API<\/b><code>G3<\/code><span>Should <a class="ref" href="\/Core%20API\/items\/1\?k=[^"]+" data-go="item:1" data-board="[^"]+" title="Core target #1">#1<\/a> greet in French\?<\/span><button data-root="[^"]+" type="button"><em>answer in SPEC\.md →<\/em><\/button>/, "a question in one repo's spec");
+ assert.match(page.show('group-needs'), /<b>Web UI<\/b><code>coordinator \(unknown\)<\/code><span>Ship <a class="ref" href="\/Web%20UI\/items\/1\?k=[^"]+" data-go="item:1" data-board="[^"]+" title="Target for #1">#1<\/a> today\?<\/span><button data-root="[^"]+" type="button"><em>decision, /, "and a decision in another's");
assert.doesNotMatch(page.show('group-needs'), /sent back|to verify|Greeting|Header/, "work sent back or waiting for a verdict is the agents', not the person's");
assert.match(page.show('group-activity'), /Core API/);
assert.match(page.show('group-activity'), /Web UI/);
assert.match(page.show('group-activity'), /Greeting|Target/);
- const activityRefs = [...page.show('group-activity').matchAll(/<button class="ref" data-root="([^"]+)" data-go="item:1" title="([^"]+)"/g)].map((link) => [link[1], link[2]]);
+ const activityRefs = [...page.show('group-activity').matchAll(/<a class="ref" href="[^"]+" data-go="item:1" data-board="([^"]+)" title="([^"]+)"/g)].map((link) => [link[1], link[2]]);
assert.ok(activityRefs.some(([root, title]) => root === core.repo && title === 'Core target #1'), 'activity links bind Core API #1 to its repo');
assert.ok(activityRefs.some(([root, title]) => root === web.repo && title === 'Target for #1'), 'activity links bind Web UI #1 to its repo');
- assert.deepEqual([...page.show('group-needs').matchAll(/<button class="ref" data-root="([^"]+)" data-go="item:1" title="([^"]+)"/g)].map((link) => [link[1], link[2]]), [
+ assert.deepEqual([...page.show('group-needs').matchAll(/<a class="ref" href="[^"]+" data-go="item:1" data-board="([^"]+)" title="([^"]+)"/g)].map((link) => [link[1], link[2]]), [
[core.repo, 'Core target #1'], [web.repo, 'Target for #1'],
], 'each duplicate #1 keeps the repo where it was written');
page.run("view.tab = 'activity'");
- await page.click({ root: core.repo, go: 'item:1' });
+ await page.click({ board: core.repo, go: 'item:1' });
assert.equal(page.run('view.root'), core.repo, 'the Core API link opens its own repo');
assert.equal(page.run('view.item'), 1, 'the Core API link opens its #1');
assert.equal(page.run('view.tab'), 'items', 'the Core API link opens its item detail');
await page.click({ root: 'group:Atlas' });
page.run("view.tab = 'activity'");
- await page.click({ root: web.repo, go: 'item:1' });
+ await page.click({ board: web.repo, go: 'item:1' });
assert.equal(page.run('view.root'), web.repo, 'the Web UI link opens its own repo');
assert.equal(page.run('view.item'), 1, 'the Web UI link opens its #1');
assert.equal(page.run('view.tab'), 'items', 'the Web UI link opens its item detail');
diff --git a/test/cockpit/references.test.js b/test/cockpit/references.test.js
index 1c6b5098..4e684f33 100644
--- a/test/cockpit/references.test.js
+++ b/test/cockpit/references.test.js
@@ -52,7 +52,7 @@ test("a shout's code reference opens that code as it was at that commit [B23]",
const button = (ref, open, before = '', block = false) => `<button class="ref${block ? ' block' : ''}" data-code="${ref}"${before ? ` data-before="${before}"` : ''} title="${ref}" aria-label="Open code reference ${ref}" type="button" aria-expanded="${open}">${label(ref)}</button>`;
const prior = (text, ref) => text.slice(0, text.indexOf(ref));
const [b1, b2, b3] = [was, now, long].map((ref) => prior(first_, ref));
- assert.ok(page.show('feed').includes(`#1</a> was ${button(was, false, b1)}, is ${button(now, false, b2)}; see ${button(long, false, b3)}.`), 'each reference is a button in the text');
+ assert.ok(page.show('feed').includes(`#1</a> was ${button(was, false, b1)}, is ${button(now, false, b2)}; see ${button(long, false, b3)}.`), 'code references stay buttons beside the item link');
await page.click({ code: was, before: b1 });
await page.click({ code: now, before: b2 });