Files
hyprcrd/public/plugins/tests/rrule.test.js
T
thandClaude Opus 4.6 7e2b130434 fixes: scratchpad, zen ESC, chat time, tooltip safety, collab sync race
- Scratchpad: card-scoped private notes in editor (toggle vs preview),
  smaller font, cleared via button, stored in cards.scratchpad
- Zen mode: ESC exits zen before closing detail, Z toggles zen
- Chat: always show absolute time (hh:mm, yesterday, or date+time)
- Backspace/Delete also deletes focused card (not just selected)
- Selected + focused cards use brand accent (not accent2)
- Tooltip: guard against non-element targets
- Collab sync: skip poll while editor is open, 2s push debounce
- Rrule test: only check geburtstag tag, not title format

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 00:45:31 +02:00

33 lines
1.2 KiB
JavaScript

import { describe, it, expect } from './runner.js?v=4';
import { state } from '../../js/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');
}
});
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);
});
});