# Arbeitszeitrechner 2026 - Next Steps & Testing Guide

**Last Updated:** 2026-01-21

## Overview

This document provides comprehensive manual testing instructions and deployment checklist for the Arbeitszeitrechner 2026 update.

## Pre-Deployment Checklist

### Code Changes

- [x] Schema `datePublished` updated to use PHP helper function ✅
- [x] All 4 `console.error` statements removed from `tools-arbeitszeit-calculator.js` ✅
- [x] All ArbZG constants verified (all unchanged for 2026) ✅
- [x] Compliance check logic reviewed and verified ✅
- [x] Test suite created and all tests passing (47/47) ✅

### Content Updates

- [x] All 8 FAQs reviewed and verified accurate ✅
- [x] Educational content verified ✅
- [x] Schema markup verified ✅
- [x] "Was ändert sich 2026?" section reviewed ✅

### Documentation

- [x] Main documentation updated ✅
- [x] Research report updated ✅
- [x] Tool-by-tool analysis updated ✅
- [x] Update summary created ✅
- [x] Next steps document created ✅

## Manual Testing Checklist

### 1. Simple Mode Testing

**Test Case 1.1: Standard Working Day**
- [ ] Enter start time: 08:00
- [ ] Enter end time: 16:30
- [ ] Enter break: 00:30
- [ ] Verify netto working time: 8.0 hours
- [ ] Verify brutto working time: 8.5 hours
- [ ] Verify break deduction: 0.5 hours

**Test Case 1.2: Early Shift**
- [ ] Enter start time: 06:00
- [ ] Enter end time: 14:00
- [ ] Enter break: 00:30
- [ ] Verify netto working time: 7.5 hours
- [ ] Verify calculations correct

**Test Case 1.3: Late Shift**
- [ ] Enter start time: 14:00
- [ ] Enter end time: 22:00
- [ ] Enter break: 00:30
- [ ] Verify netto working time: 7.5 hours
- [ ] Verify calculations correct

**Test Case 1.4: Overnight Shift**
- [ ] Enter start time: 22:00
- [ ] Enter end time: 06:00
- [ ] Enter break: 00:30
- [ ] Verify netto working time: 7.5 hours (overnight handling)
- [ ] Verify calculations correct

**Test Case 1.5: Multiple Days**
- [ ] Add multiple days (e.g., 5 days)
- [ ] Enter different times for each day
- [ ] Verify total calculation across all days
- [ ] Verify individual day calculations

**Test Case 1.6: Edge Cases**
- [ ] Enter same start/end time (should show 0 hours)
- [ ] Enter break longer than work period (should handle gracefully)
- [ ] Enter invalid time format (should show validation error)
- [ ] Remove all days (should handle gracefully)

### 2. Advanced Mode Testing

**Test Case 2.1: Single Day Period**
- [ ] Select period: Today to Today
- [ ] Add single work segment: 08:00-16:30
- [ ] Add break: 12:00-12:30
- [ ] Verify working time calculation: 8.0 hours
- [ ] Verify compliance status: OK
- [ ] Verify no violations

**Test Case 2.2: Week Period**
- [ ] Select period: Monday to Friday (5 days)
- [ ] Apply bulk settings: 08:00-16:30, 30min break
- [ ] Verify all 5 days populated correctly
- [ ] Verify total working time: ~40 hours
- [ ] Verify weekly average: ~40 hours/week
- [ ] Verify compliance status: OK

**Test Case 2.3: Multiple Segments Per Day**
- [ ] Add day with two segments: 08:00-12:00, 13:00-17:00
- [ ] Add break: 12:00-12:30
- [ ] Verify working time: 8.0 hours (segments combined correctly)
- [ ] Verify break overlap calculated correctly
- [ ] Verify no double-counting

**Test Case 2.4: Overlapping Segments**
- [ ] Add day with overlapping segments: 08:00-14:00, 12:00-18:00
- [ ] Verify working time: 10.0 hours (overlap counted once)
- [ ] Verify calculation handles overlap correctly

**Test Case 2.5: Holiday Detection**
- [ ] Select period including a known holiday (e.g., 1. Mai 2026)
- [ ] Select appropriate Bundesland
- [ ] Verify holiday is detected and marked
- [ ] Verify holiday work warning appears if work > 2 hours
- [ ] Verify holiday hours counted separately

**Test Case 2.6: Weekend Detection**
- [ ] Select period including weekend
- [ ] Add work on Saturday/Sunday
- [ ] Verify weekend work warning appears if work > 2 hours
- [ ] Verify Sunday hours counted separately

**Test Case 2.7: Night Work Detection**
- [ ] Add work segment: 22:00-06:00
- [ ] Verify night work detected (23:00-06:00)
- [ ] Verify night hours calculated correctly
- [ ] Verify night hours displayed in results

**Test Case 2.8: Multiple Breaks**
- [ ] Add day with multiple breaks
- [ ] Verify all breaks calculated correctly
- [ ] Verify break overlap with working time calculated correctly
- [ ] Verify total break time correct

### 3. Compliance Check Testing

**Test Case 3.1: Maximum Daily Work Violation (Regular)**
- [ ] Add day with 10.5 hours work (e.g., 08:00-18:30, 30min break)
- [ ] Verify violation detected: "Arbeitszeit über 10 Stunden"
- [ ] Verify violation severity: error
- [ ] Verify violation paragraph: § 3 ArbZG

**Test Case 3.2: Maximum Daily Work Violation (Minor)**
- [ ] Enable minor mode
- [ ] Add day with 8.5 hours work
- [ ] Verify violation detected: "Tägliche Arbeitszeit über 8 Stunden (JArbSchG)"
- [ ] Verify violation severity: error

**Test Case 3.3: Break Requirement Violation (>6h without 30min)**
- [ ] Add day with 6.5 hours work, 25min break
- [ ] Verify violation detected: "Mindestens 30 Minuten Pause erforderlich"
- [ ] Verify violation severity: error
- [ ] Verify violation paragraph: § 4 ArbZG

**Test Case 3.4: Break Requirement Violation (>9h without 45min)**
- [ ] Add day with 9.5 hours work, 40min break
- [ ] Verify violation detected: "Mindestens 45 Minuten Pause erforderlich"
- [ ] Verify violation severity: error

**Test Case 3.5: Minor Break Requirement Violation (>6h without 60min)**
- [ ] Enable minor mode
- [ ] Add day with 6.5 hours work, 55min break
- [ ] Verify violation detected: "Mindestens 60 Minuten Pause erforderlich"
- [ ] Verify violation paragraph: JArbSchG

**Test Case 3.6: Continuous Work Violation (Regular)**
- [ ] Add day with 6.25 hours continuous work (no breaks)
- [ ] Verify violation detected: "Pause spätestens nach 6 Stunden ununterbrochener Tätigkeit"
- [ ] Verify violation severity: error

**Test Case 3.7: Continuous Work Violation (Minor)**
- [ ] Enable minor mode
- [ ] Add day with 4.75 hours continuous work (no breaks)
- [ ] Verify violation detected: "Pause spätestens nach 4.5 Stunden ununterbrochener Tätigkeit"
- [ ] Verify violation paragraph: JArbSchG

**Test Case 3.8: Sunday Work Warning**
- [ ] Add work on Sunday (>2 hours)
- [ ] Verify warning: "Sonntagsarbeit - Ersatzruhetag binnen 2 Wochen erforderlich"
- [ ] Verify warning severity: warning
- [ ] Verify warning paragraph: § 9-11 ArbZG

**Test Case 3.9: Holiday Work Warning**
- [ ] Add work on holiday (>2 hours)
- [ ] Verify warning: "Feiertagsarbeit - Ersatzruhetag binnen 2 Wochen erforderlich"
- [ ] Verify warning severity: warning

**Test Case 3.10: Weekly Average Violation (EU 48h)**
- [ ] Add 7 days with 7 hours each (49 hours/week)
- [ ] Verify violation detected: "EU-48h-Grenze überschritten: Ø 49.0h/Woche"
- [ ] Verify violation severity: error

**Test Case 3.11: Weekly Average Violation (Minor 40h)**
- [ ] Enable minor mode
- [ ] Add 5 days with 8.5 hours each (42.5 hours/week)
- [ ] Verify violation detected: "Wöchentliche Arbeitszeit über 40 Stunden: 42.5h"
- [ ] Verify violation severity: error

**Test Case 3.12: Multiple Violations**
- [ ] Add day exceeding daily limit AND insufficient break
- [ ] Verify multiple violations detected
- [ ] Verify violations sorted by severity
- [ ] Verify all violations displayed

### 4. Export Functionality Testing

**Test Case 4.1: PDF Export**
- [ ] Calculate working time (Simple or Advanced mode)
- [ ] Click "Als PDF exportieren"
- [ ] Verify PDF generated successfully
- [ ] Verify PDF contains:
  - [ ] Working time summary
  - [ ] Daily breakdown (if Advanced mode)
  - [ ] Compliance status
  - [ ] Violations (if any)
  - [ ] Correct year (2026)
- [ ] Verify PDF formatting correct

**Test Case 4.2: CSV Export**
- [ ] Calculate working time (Advanced mode with multiple days)
- [ ] Click "Als CSV exportieren"
- [ ] Verify CSV downloaded successfully
- [ ] Open CSV in Excel/spreadsheet
- [ ] Verify CSV contains:
  - [ ] Headers
  - [ ] Daily data rows
  - [ ] Summary row
  - [ ] Correct formatting
- [ ] Verify data matches calculator results

**Test Case 4.3: Email Gating (PDF/CSV)**
- [ ] Attempt to export PDF/CSV without email
- [ ] Verify email collection modal appears
- [ ] Enter email address
- [ ] Submit email
- [ ] Verify export proceeds after email collection
- [ ] Verify email stored correctly (if applicable)

### 5. Responsive Design Testing

**Test Case 5.1: Mobile View (< 640px)**
- [ ] Open page on mobile device/browser
- [ ] Verify layout adapts correctly
- [ ] Verify input fields usable
- [ ] Verify results display correctly
- [ ] Verify buttons accessible
- [ ] Verify modals work correctly

**Test Case 5.2: Tablet View (640px - 1024px)**
- [ ] Open page on tablet/browser
- [ ] Verify layout adapts correctly
- [ ] Verify optimal use of space
- [ ] Verify all features accessible

**Test Case 5.3: Desktop View (> 1024px)**
- [ ] Open page on desktop browser
- [ ] Verify full layout displays
- [ ] Verify optimal use of space
- [ ] Verify all features accessible

### 6. Schema Validation Testing

**Test Case 6.1: Google Rich Results Test**
- [ ] Navigate to: https://search.google.com/test/rich-results
- [ ] Enter URL: https://www.ordio.com/tools/arbeitszeitrechner
- [ ] Run test
- [ ] Verify WebApplication schema validates
- [ ] Verify FAQPage schema validates
- [ ] Verify WebPage schema validates
- [ ] Verify no errors or warnings

**Test Case 6.2: Schema.org Validator**
- [ ] Use Schema.org validator: https://validator.schema.org/
- [ ] Enter URL or paste schema JSON
- [ ] Verify all schemas validate
- [ ] Verify no errors

### 7. Content Verification Testing

**Test Case 7.1: Year References**
- [ ] Search page for "2025" (should only appear in historical context)
- [ ] Verify all "2026" references correct
- [ ] Verify schema dates use current date (not hardcoded)

**Test Case 7.2: ArbZG Constants**
- [ ] Verify all displayed limits match 2026 law:
  - [ ] Daily: 8h/10h (regular), 8h (minor)
  - [ ] Breaks: 30min/45min (regular), 30min/60min (minor)
  - [ ] Rest period: 11 hours
  - [ ] Continuous: 6h (regular), 4.5h (minor)
  - [ ] Weekly: 48h (EU), 40h (minor)

**Test Case 7.3: FAQ Accuracy**
- [ ] Read all 8 FAQs
- [ ] Verify answers accurate and current
- [ ] Verify examples calculate correctly
- [ ] Verify links work (if any)

**Test Case 7.4: Educational Content**
- [ ] Review educational sections
- [ ] Verify ArbZG explanations accurate
- [ ] Verify compliance violation explanations clear
- [ ] Verify examples realistic

### 8. Performance Testing

**Test Case 8.1: Page Load Performance**
- [ ] Open page in browser
- [ ] Check Network tab in DevTools
- [ ] Verify page loads < 3 seconds
- [ ] Verify LCP (Largest Contentful Paint) < 2.5s
- [ ] Verify no console errors

**Test Case 8.2: Calculation Performance**
- [ ] Add 30 days of entries (Advanced mode)
- [ ] Click calculate
- [ ] Verify calculation completes quickly (< 1 second)
- [ ] Verify no performance degradation
- [ ] Verify UI remains responsive

**Test Case 8.3: Holiday Loading Performance**
- [ ] Select period spanning multiple years
- [ ] Verify holidays load efficiently
- [ ] Verify caching works (no duplicate API calls)
- [ ] Verify no blocking operations

### 9. Error Handling Testing

**Test Case 9.1: Invalid Date Range**
- [ ] Enter end date before start date
- [ ] Verify error message displayed
- [ ] Verify calculation prevented
- [ ] Verify no console errors

**Test Case 9.2: Invalid Time Format**
- [ ] Enter invalid time (e.g., "25:00", "abc")
- [ ] Verify validation error displayed
- [ ] Verify calculation prevented
- [ ] Verify user-friendly error message

**Test Case 9.3: Missing Holiday Service**
- [ ] Simulate HolidayService unavailable
- [ ] Verify calculator still works
- [ ] Verify holiday detection gracefully disabled
- [ ] Verify no console errors

**Test Case 9.4: Network Errors**
- [ ] Simulate network failure during holiday loading
- [ ] Verify calculator still works
- [ ] Verify fallback to no holidays
- [ ] Verify no console errors

## Deployment Checklist

### Pre-Deployment

- [x] All automated tests passing ✅
- [ ] Manual testing completed (see above)
- [ ] Schema validation completed
- [ ] Performance check completed
- [ ] Content review completed
- [ ] Error handling verified

### Deployment Steps

1. **Code Review**
   - [ ] Review all changes in `tools_arbeitszeitrechner.php`
   - [ ] Review all changes in `tools-arbeitszeit-calculator.js`
   - [ ] Verify no unintended changes

2. **Test Suite Execution**
   - [ ] Run automated test suite: `node v2/scripts/dev-helpers/test-arbeitszeit-calculations.js`
   - [ ] Verify all 47 tests pass
   - [ ] Document test results

3. **Browser Testing**
   - [ ] Test in Chrome (latest)
   - [ ] Test in Firefox (latest)
   - [ ] Test in Safari (latest)
   - [ ] Test in Edge (latest)
   - [ ] Test on mobile devices (iOS/Android)

4. **Schema Validation**
   - [ ] Run Google Rich Results Test
   - [ ] Verify all schemas validate
   - [ ] Fix any validation errors

5. **Performance Check**
   - [ ] Run PageSpeed Insights
   - [ ] Verify no regressions
   - [ ] Verify performance targets met

6. **Deploy to Staging**
   - [ ] Deploy changes to staging environment
   - [ ] Run full test suite on staging
   - [ ] Verify all functionality works

7. **Deploy to Production**
   - [ ] Deploy changes to production
   - [ ] Monitor for errors
   - [ ] Verify page loads correctly
   - [ ] Verify calculations work correctly

### Post-Deployment

- [ ] Monitor error logs for 24 hours
- [ ] Verify no console errors in production
- [ ] Verify schema validation still passes
- [ ] Verify user feedback (if any)
- [ ] Document deployment completion

## Verification Commands

### Run Automated Tests

```bash
node v2/scripts/dev-helpers/test-arbeitszeit-calculations.js
```

**Expected Output:**
- Total Tests: 47
- Passed: 47
- Failed: 0
- Success Rate: 100.0%

### Check for Console Statements

```bash
grep -r "console\.\(log\|error\|warn\|debug\|info\)" v2/js/tools-arbeitszeit-calculator.js
```

**Expected Output:** No matches (empty)

### Verify Schema Dates

```bash
grep -n "datePublished" v2/pages/tools_arbeitszeitrechner.php
```

**Expected Output:** Should show PHP helper function, not hardcoded date

### Check ArbZG Constants

```bash
grep -n "maxDailyHours\|BREAK\|CONTINUOUS\|WEEKLY" v2/js/tools-arbeitszeit-calculator.js | head -20
```

**Expected Output:** Should show correct constants matching 2026 law

## Notes

### Known Limitations

1. **Rest Period Calculation:** Current implementation only calculates time from end of work to midnight, not between consecutive days. This is acceptable for single-day calculations but could be enhanced for multi-day period analysis.

2. **Proposed Changes:** The "Was ändert sich 2026?" section mentions proposals for weekly maximums (instead of daily). These are NOT yet law and should not be implemented in the calculator logic.

### Future Enhancements

- Consider improving rest period calculation for consecutive day analysis
- Add more industry templates
- Add comparison mode (multiple scenarios)
- Add historical data visualization
- Improve compliance violation explanations
- Add more export formats (Excel)

## Summary

The Arbeitszeitrechner has been comprehensively reviewed and updated for 2026 compliance. All automated tests pass (47/47), code quality has been improved, and all documentation has been updated. The tool is ready for manual testing and deployment.

**Status:** ✅ COMPLETED - Ready for manual testing and deployment
