Commit graph

1 commit

Author SHA1 Message Date
TheFlow
42f0bc7d8c test: add comprehensive coverage for governance and markdown utilities
Coverage Improvements (Task 3 - Week 1):
- governance.routes.js: 31.81% → 100% (+68.19%)
- markdown.util.js: 17.39% → 89.13% (+71.74%)

New Test Files:
- tests/integration/api.governance.test.js (33 tests)
  - Authentication/authorization for all 6 governance endpoints
  - Request validation (missing fields, invalid input)
  - Admin-only access control enforcement
  - Framework component testing (classify, validate, enforce, pressure, verify)

- tests/unit/markdown.util.test.js (60 tests)
  - markdownToHtml: conversion, syntax highlighting, XSS sanitization (23 tests)
  - extractTOC: heading extraction and slug generation (11 tests)
  - extractFrontMatter: YAML front matter parsing (10 tests)
  - generateSlug: URL-safe slug generation (16 tests)

This completes Week 1, Task 3: Increase test coverage on critical services.
Previous tasks in same session:
- Task 1: Fixed 29 production test failures ✓
- Task 2: Completed Koha security implementation ✓

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-09 21:32:13 +13:00