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(relay): read approval titles directly (#1016) [C7,H17,H5]

Corey Olson3f82bcc93db9
diff --git a/test/relay-browser.test.js b/test/relay-browser.test.js
index 75333a7d..5b45be14 100644
--- a/test/relay-browser.test.js
+++ b/test/relay-browser.test.js
@@ -962,7 +962,7 @@ test('the link approval card names the computer and the board [H17,H5]', {
await chrome.navigate(box.origin);
await chrome.waitFor(`document.querySelector('.phone-approval[data-request="${proposal.context.id}"] button') !== null`);
const card = await readApprovalCard(chrome, proposal.context.id);
- assert.match(card.text, /^Link notes from studio\?$/mu, 'the card asks in words which computer links which board');
+ assert.match(card.title, /^Link notes from studio\?$/u, 'the card asks in words which computer links which board');
assert.equal(card.text.includes('fixture/repository'), true, 'the card names the repository being linked');
assert.equal(card.text.includes('expires ' + phoneExpiry(proposal.context.expires)), true, 'the expiry is in the phone\'s local time');
assert.equal(card.text.includes(new Date(proposal.context.expires).toISOString()), false, 'no UTC timestamp on the card');
@@ -990,7 +990,7 @@ test('the delete card names the board and confirms the delete [H17,H5]', {
const selector = `.phone-approval[data-request="${context.id}"]`;
await chrome.waitFor(`document.querySelector('${selector} button') !== null`);
const card = await readApprovalCard(chrome, context.id);
- assert.match(card.text, /^Delete notes from the relay\?$/mu, 'the delete card names the board');
+ assert.match(card.title, /^Delete notes from the relay\?$/u, 'the delete card names the board');
assert.equal(card.text.includes('studio'), true, 'the delete card names the computer that asked');
assert.doesNotMatch(card.text, /[0-9a-f]{32}/u, 'no raw board id on the delete card');
assert.equal(card.inside, true, 'the delete card keeps its text inside its padding');
diff --git a/test/relay-studio-fixture.js b/test/relay-studio-fixture.js
index bd0eecc5..5fbda0ff 100644
--- a/test/relay-studio-fixture.js
+++ b/test/relay-studio-fixture.js
@@ -95,7 +95,8 @@ export function readApprovalCard(chrome, request) {
const range = document.createRange(); range.selectNodeContents(node);
return [...range.getClientRects()].map(rect => ({ left: rect.left, right: rect.right, top: rect.top, bottom: rect.bottom }));
});
- return { text: card.innerText.replace(/[\\u00a0\\u202f]/gu, ' '), pad, lines,
+ return { title: card.querySelector('.phone-approval-title')?.innerText.replace(/[\\u00a0\\u202f]/gu, ' ') ?? null,
+ text: card.innerText.replace(/[\\u00a0\\u202f]/gu, ' '), pad, lines,
inside: lines.length > 0 && lines.every(rect => rect.left >= inner.left - 0.5 && rect.right <= inner.right + 0.5 &&
rect.top >= inner.top - 0.5 && rect.bottom <= inner.bottom + 0.5),
action: card.querySelector('button')?.innerText ?? null };