Erstellen einer ersten test-Komponente die in der Mockup-HTML-Seite und in Contao eingebunden werden kann

This commit is contained in:
Robert Wartenberg committed 2026-08-20 12:28:57 +02:00
1 parent e96c73000d
commit 76e45ac9ad
12 files changed
+217 -114

No files matched your search

@@ -7,6 +7,14 @@ Describe 'Perspektivwerk static route' {
(Test-Path -LiteralPath $mockupPath) | Should Be $true
}
It 'embeds the appointment booking component with its public assets' {
$mockup = Get-Content -LiteralPath $mockupPath -Raw
$mockup | Should Match 'href="/booking/booking\.css"'
$mockup | Should Match 'data-sufw-booking'
$mockup | Should Match 'src="/booking/booking\.js"'
}
It 'routes /perspektivwerk to the static entry point before the Contao fallback' {
$htaccess = Get-Content -LiteralPath $htaccessPath -Raw
$staticRouteIndex = $htaccess.IndexOf('RewriteRule ^perspektivwerk/?$ perspektivwerk/index.html [L]')
+16
View File
@@ -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'), []);
});