17 lines
616 B
JavaScript
17 lines
616 B
JavaScript
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'), []);
|
|
});
|