Skip to content

Add comprehensive test coverage (target 80%+) #42

Description

@thedhanawada

Problem

Current test coverage is ~15-20%. Existing tests cover StateManager, EventForm, and DOMUtils but many modules have zero coverage.

Scope

Add tests for:

  • BaseComponent lifecycle
  • ForceCalendar (main component) — initialization, view switching, event handling
  • MonthViewRenderer
  • WeekViewRenderer
  • DayViewRenderer
  • EventBus — subscription, wildcards, cleanup
  • StyleUtils
  • DateUtils (interface-specific)

Acceptance Criteria

  • 80%+ line coverage
  • All renderers have rendering tests (snapshot or DOM assertion)
  • Event delegation tested
  • View switching tested

Activity

  1. thedhanawada commented on Oct 2, 2026

    @thedhanawada
    ContributorAuthor

    Verified against released master commit 01452be (v1.8.1), without the pending PR #84 changes:

    jest --runInBand --coverage --collectCoverageFrom='src/**/*.js' --coverageReporters=text-summary

    All 15 suites / 193 tests passed. Whole-source line coverage is 80.39% (1415/1760); statements 78.50%, branches 67.19%, functions 78.87%. Tests now exercise component lifecycle, main initialization/API/view switching, month/week/day rendering and accessibility, delegation, EventBus, date/DOM helpers, and drag behavior. This satisfies the stated 80%+ line target and renderer/delegation/view-switch acceptance criteria. Closing as completed; continued branch/edge-case improvement remains worthwhile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    phase:0-foundationImmediate fixes and test infrastructurepriority:criticalMust fix before any releasetype:testingTest coverage and infrastructure

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions