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): read semantic chip tones and reject count markup [N26]

Corey Olsonbbfaf43a8ddb
diff --git a/test/cockpit/fixture.js b/test/cockpit/fixture.js
index c2c88411..3815228d 100644
--- a/test/cockpit/fixture.js
+++ b/test/cockpit/fixture.js
@@ -1124,7 +1124,7 @@ async function readRoadmap(chrome) {
rows: [...card.querySelectorAll('.milestone-item')].map((row) => {
const chip = row.querySelector('.chip'), title = row.querySelector('.t'), style = getComputedStyle(title), box = chip.getBoundingClientRect();
return {
- id: row.querySelector('.id').innerText, label: chip.innerText, tone: [...chip.classList].filter((name) => name !== 'chip').join(' '),
+ id: row.querySelector('.id').innerText, label: chip.innerText, tone: [...chip.classList].filter((name) => ['ok', 'no', 'warn', 'busy', 'free'].includes(name)).join(' '),
seen: box.width > 0 && box.height > 0 && getComputedStyle(chip).visibility === 'visible',
chip: paint(chip), dot: getComputedStyle(row.querySelector('.dot')).backgroundColor,
button: row.matches('button,[role="button"]'), tip: row.title, title: [...title.childNodes].slice(1).map((node) => node.textContent).join(''),
diff --git a/test/cockpit/roadmap.test.js b/test/cockpit/roadmap.test.js
index 83c75525..6ff3729a 100644
--- a/test/cockpit/roadmap.test.js
+++ b/test/cockpit/roadmap.test.js
@@ -953,6 +953,10 @@ test('the roadmap shows landed, accepted and past target [N26]', { timeout: 90_0
assert.equal(await chrome.stable(`${milestone('State summary')}.querySelector('[data-summary-state=building] b').textContent`),'1');
await chrome.stable("data.project.items=window.__originalItems;const m=data.project.milestones.find(m=>m.name==='State summary');m.items=window.__originalRoadmapItems;m.summary.estimate=null;m.summary.needsYou=[];render();true");
assert.equal(await chrome.stable(`${milestone('State summary')}.querySelectorAll('.roadmap-estimate,.roadmap-pace,.roadmap-summary-needs').length`),0,'absent JSON omits forecast and person line');
+ // A hand-edited snapshot can contain malformed counts; those values must remain inert [C5].
+ await chrome.stable(`(()=>{const m=data.project.milestones.find(m=>m.name==='State summary');const value='"><img src=x onerror="window.__badRoadmapCount=true">';m.summary={...m.summary,total:value,landed:value,left:value};m.total=value;m.landed=value;render();return true})()`);
+ assert.equal(await chrome.stable("document.querySelectorAll('#roadmap img,[data-status=release] img').length"),0,'malformed supplied counts never become HTML');
+
assert.deepEqual(chrome.exceptions,[]);
} finally {if(chrome)await closeSnapshotChrome(chrome);rmSync(profile,{recursive:true,force:true});await view.stop();}