Add health product portfolio and explicit tender item selection
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import {selectPortfolioProduct} from '../src/services/healthPortfolio.js';
|
||||
import {HEALTH_CHECKS} from '../src/services/preparationChecks.js';
|
||||
test('portfolio selection preserves declaration snapshot without approving tender requirements',()=>{
|
||||
const item={id:'device',group:'Analiz',brand:'QA',model:'M1',kind:'device',utsStatus:'declared',utsReference:'TEST',serviceCapacity:'2 uzman'};
|
||||
const check=selectPortfolioProduct(item);item.model='Changed';
|
||||
assert.equal(check.portfolioSnapshot.model,'M1');assert.equal(check.product,'Analiz · QA · M1');
|
||||
assert.equal(check.status,'pending');assert.equal(check.source,'');
|
||||
for(const [key] of HEALTH_CHECKS)assert.deepEqual(check[key],{status:'pending',evidence:''});
|
||||
const manual=selectPortfolioProduct(null);assert.equal(manual.portfolioId,null);assert.equal(manual.portfolioSnapshot,null);
|
||||
});
|
||||
Reference in New Issue
Block a user