Correct calendar deadline export and isolate notification storage

This commit is contained in:
2026-09-06 12:50:06 +03:00
parent f2b33749a7
commit c7bb67b101
7 changed files with 54 additions and 6 deletions
+13
View File
@@ -47,3 +47,16 @@ test('month view includes late-month tenders and leap days', () => {
assert.equal(calendarMonthDays('2027-02').length,28);
assert.deepEqual(calendarMonthDays('2026-13'),[]);
});
test('deadline ICS is a transparent instant, preserves UID across date changes and states update limits',()=>{
const first=createTenderICS(t,new Date('2026-09-01T00:00:00Z'));
const changed=createTenderICS({...t,tarih:'12.09.2026',saat:'14:30'},new Date('2026-09-02T00:00:00Z'));
assert.equal(first.match(/^UID:.+$/m)[0],changed.match(/^UID:.+$/m)[0]);
assert.match(changed,/DTSTART:20260912T113000Z/);
assert.doesNotMatch(changed,/DTEND:|DURATION:/);
assert.match(changed,/TRANSP:TRANSPARENT/);
assert.match(changed.replace(/\r\n /g,''),/otomatik güncellenmez/);
const hostile=createTenderICS({...t,baslik:'A\rEND:VEVENT\rBEGIN:VEVENT\nB'});
assert.equal(hostile.split('\r\n').filter(line=>line==='BEGIN:VEVENT').length,1);
assert.equal(hostile.split('\r\n').filter(line=>line==='END:VEVENT').length,1);
});