Files
ihaleist/tests/official-five-evidence.test.mjs
T

29 lines
1.5 KiB
JavaScript
Raw 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 fs from 'node:fs';
const evidence = JSON.parse(fs.readFileSync(new URL('../docs/quality/evidence/qa-official-five-tenders.json', import.meta.url), 'utf8'));
test('official five-tender evidence is complete and records the Aksaray date discrepancy', () => {
assert.equal(evidence.scope, 'Salt okunur EKAP API sorgusu; teklif, ödeme veya başvuru gönderilmedi.');
assert.equal(evidence.cases.length, 5);
assert.equal(new Set(evidence.cases.map((item) => item.ikn)).size, 5);
for (const item of evidence.cases) {
assert.equal(item.status, 'İhale İlanı Yayımlanmış, Katılıma Açık');
assert.equal(item.announcementPresent, true);
assert.match(item.tenderDateTime, /^\d{2}\.\d{2}\.2026 \d{2}:\d{2}$/);
assert.ok(item.textChars > 100);
assert.ok(item.textSha256);
}
const aksaray = evidence.cases.find((item) => item.ikn === '2026/1573235');
assert.equal(aksaray.tenderDateTime, '16.09.2026 10:00');
assert.equal(aksaray.parsedAnnouncement.tarih, '16.09.2026');
assert.equal(aksaray.dateConsistency.announcementHtml, '09.09.2026 10:00');
assert.match(aksaray.parsedAnnouncement.sourceDateWarning, /güncel detay tarihi esas alındı/);
assert.equal(evidence.documentLinkChecks.cases.length, 5);
for (const check of evidence.documentLinkChecks.cases) {
assert.equal(check.hasUrl, true);
assert.ok(Number.isInteger(check.dokumanSayisi) && check.dokumanSayisi >= 0);
}
});