Buchungskalender: Portal-Tests mit fester Uhr
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8c8fa05591
commit
10fe9a2ae0
3 files changed
+10
-3
No files matched your search
@@ -178,7 +178,6 @@ export async function render(panel, ctx) {
|
||||
if (typeof link === 'string' && link) {
|
||||
const meldung = h('p', { class: 'sh-hinweis', role: 'status' })
|
||||
box.append(
|
||||
h('p', null, 'Falls die Mail nicht ankommt, kannst du den Link selbst schicken:'),
|
||||
h('input', { type: 'text', readonly: true, value: link, 'aria-label': 'Buchungslink', 'data-link': true }),
|
||||
h('button', {
|
||||
type: 'button', class: 'kb-btn-outline', 'data-aktion': 'link-kopieren',
|
||||
|
||||
@@ -9,7 +9,10 @@ export const tagMs = (tag) => { const [j, m, t] = String(tag).split('-').map(Num
|
||||
export const msTag = (ms) => new Date(ms).toISOString().slice(0, 10)
|
||||
export const plusTage = (tag, n) => msTag(tagMs(tag) + n * 86400000)
|
||||
/** Heute als Berlin-Datum. */
|
||||
export const heuteBerlin = () => new Date().toLocaleDateString('sv-SE', { timeZone: 'Europe/Berlin' })
|
||||
let jetzt = () => new Date()
|
||||
/** Uhr der Portal-Reiter austauschen (nur fuer Tests); ohne Argument zurueck auf die echte Uhr. */
|
||||
export const setzeUhrFuerTests = (fn) => { jetzt = fn || (() => new Date()) }
|
||||
export const heuteBerlin = () => jetzt().toLocaleDateString('sv-SE', { timeZone: 'Europe/Berlin' })
|
||||
/** '2026-11-12' ⇒ '12.11.2026'. */
|
||||
export const tagText = (tag) => { const m = /^(\d{4})-(\d{2})-(\d{2})$/.exec(tag || ''); return m ? `${m[3]}.${m[2]}.${m[1]}` : '' }
|
||||
|
||||
|
||||
@@ -192,8 +192,13 @@ const zeigeTab = async (fx, modul) => {
|
||||
}
|
||||
const kal = await import('../public/buchungen-tab-kalender.js')
|
||||
const ukTab = await import('../public/buchungen-tab-unterkuenfte.js')
|
||||
import { setzeUhrFuerTests } from '../public/buchungen-uk-hilfe.js'
|
||||
setzeUhrFuerTests(() => new Date('2026-10-07T10:00:00Z')) // feste Uhr: Kalender und Sperren-Tests nutzen Daten im Herbst 2026
|
||||
const tag = (fx, panel, t) => fx.finde(panel, `[data-tag="${t}"]`)
|
||||
const gehZuNovember = async (fx, panel) => { while (!/November 2026/.test(fx.text(fx.finde(panel, '[data-monat]')))) { await fx.klick(aktion(fx, panel, 'weiter')); await fx.ruhe() } }
|
||||
const gehZuNovember = async (fx, panel) => {
|
||||
for (let i = 0; i < 24 && !/November 2026/.test(fx.text(fx.finde(panel, '[data-monat]'))); i += 1) { await fx.klick(aktion(fx, panel, 'weiter')); await fx.ruhe() }
|
||||
assert.match(fx.text(fx.finde(panel, '[data-monat]')), /November 2026/, 'November 2026 nicht erreicht')
|
||||
}
|
||||
|
||||
test('rasterTage: November 2026 beginnt am Montag 26.10. und endet am Sonntag 29.11.... ', () => {
|
||||
const t = kal.rasterTage(2026, 10)
|
||||
|
||||
Reference in new issue
Block a user