UI-tests und fixes aus tests

This commit is contained in:
th committed 2026-04-09 22:52:40 +02:00
1 parent 968d980be1
commit b5e30afd0b
12 files changed
+847 -184

No files matched your search

+34
View File
@@ -0,0 +1,34 @@
import { describe, it, expect } from './runner.js';
import { state } from '../modules/state.js';
// RRULE is set by CalDAV sync, not via PATCH. Test the data model and existing cards.
describe('RRULE: Data Model', () => {
it('cards with caldav_rrule exist in state (if synced)', () => {
const withRrule = state.cards.filter(c => c.caldav_rrule);
// May be 0 if no CalDAV configured — just ensure no crash
expect(Array.isArray(withRrule)).toBe(true);
});
it('birthday cards have geburtstag tag', () => {
const birthdays = state.cards.filter(c => (c.tags || '').includes('geburtstag'));
for (const b of birthdays) {
expect(b.tags).toContain('geburtstag');
// Birthday titles start with date
expect(b.title).toMatch(/^\d{4}-\d{2}-\d{2}/);
}
});
it('termin cards have termin tag', () => {
const termine = state.cards.filter(c => (c.tags || '').split(',').includes('termin'));
for (const t of termine) {
expect(t.tags).toContain('termin');
}
});
it('caldav_uid is unique per card', () => {
const uids = state.cards.filter(c => c.caldav_uid).map(c => c.caldav_uid);
const unique = new Set(uids);
expect(unique.size).toBe(uids.length);
});
});