Personal Telegram developer console for GitHub

test(ux): cover platform rows 8-12

davoodmehraban89 committed Oct 5, 2026 at 08:17 UTC ef63c88091b937bbb189e60f736165575babceb5
1 file changed +8
test/platform-experience.test.js new
+8
@@ -0,0 +1,8 @@
1 +import test from'node:test';import assert from'node:assert/strict';import{UX_CAPABILITIES,buildCopilotBrief,evaluateBrowserQa,buildPluginCatalog,buildPortfolio,searchCommandCenter}from'../src/core/platform-experience.js';import{platformHomeView,platformCapabilityView}from'../src/platform-menu.js';
2 +test('rows 8-12 are explicit and bounded',()=>assert.deepEqual(UX_CAPABILITIES.map(x=>x.id),[8,9,10,11,12]));
3 +test('copilot is evidence grounded and cannot mutate',()=>{const x=buildCopilotBrief({goal:'fix',evidence:['token=abc failure']});assert.equal(x.canMutate,false);assert.doesNotMatch(JSON.stringify(x),/abc/);});
4 +test('browser QA never invents pass without evidence',()=>{assert.equal(evaluateBrowserQa([{label:'home'}]).status,'blocked');assert.equal(evaluateBrowserQa([{label:'home',status:'pass',evidence:'HTTP 200'}]).status,'passed');});
5 +test('plugin catalog preserves declared risks',()=>assert.equal(buildPluginCatalog([{id:'g',actions:[{id:'x',risk:'WRITE'}]}])[0].actions[0].risk,'WRITE'));
6 +test('portfolio clamps unknown status',()=>assert.equal(buildPortfolio([{id:1,name:'a',status:'magic'}])[0].status,'unknown'));
7 +test('command center search is bounded',()=>assert.equal(searchCommandCenter('repo',Array.from({length:30},(_,i)=>({title:'repo '+i}))).length,12));
8 +test('platform UI exposes all five capabilities with safe callbacks',()=>{const v=platformHomeView();assert.equal(v.reply_markup.inline_keyboard.length,6);for(const c of UX_CAPABILITIES)assert.match(platformCapabilityView(c.key).text,new RegExp(String(c.id)));});