Erstellen einer ersten test-Komponente die in der Mockup-HTML-Seite und in Contao eingebunden werden kann
This commit is contained in:
1 parent
e96c73000d
commit
76e45ac9ad
12 files changed
+217
-114
No files matched your search
@@ -0,0 +1,16 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
|
||||
import { getSlotsForDate } from '../public/booking/booking.js';
|
||||
|
||||
test('liefert für einen Beispieltag verfügbare und belegte Slots', () => {
|
||||
const slots = getSlotsForDate('perspektivwerk', '2026-08-25');
|
||||
|
||||
assert.equal(slots.length, 3);
|
||||
assert.equal(slots.filter((slot) => slot.status === 'available').length, 2);
|
||||
assert.equal(slots.filter((slot) => slot.status === 'booked').length, 1);
|
||||
});
|
||||
|
||||
test('liefert für einen Tag ohne Termin keine Slots', () => {
|
||||
assert.deepEqual(getSlotsForDate('produktionsschule', '2026-08-20'), []);
|
||||
});
|
||||
Reference in new issue
Block a user