Files
ihaleist/tests/search-tender.test.mjs

13 lines
800 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import {test} from 'node:test';
import assert from 'node:assert/strict';
import {searchTender} from '../src/services/searchTender.js';
test('search-only tender becomes a stable detail without fabricated bid or classification fields',()=>{
const source={ikn:'2026/1538773',baslik:'Laboratuvar hizmeti',tur:'Hizmet Alımı',ihaleTarihSaat:'22.09.2026 11:30'};
const t=searchTender(source);
assert.equal(t.id,'ekap-2026/1538773');assert.equal(t.alimTuru,'Hizmet Alımı');
assert.equal(t.tarih,'22.09.2026');assert.equal(t.saat,'11:30');assert.deepEqual(t.items,[]);
const unknown=searchTender({...source,ihaleTarihSaat:'bilinmiyor'});
assert.equal(unknown.tarih,'');assert.equal(unknown.saat,'');assert.equal(unknown.aciklama,'');
assert.throws(()=>searchTender({...source,ikn:'unknown'}));
});