Skip to content

test(render): add unit tests for SpaceHandlerImpl - #1535

Open
sabhi128 wants to merge 1 commit into
OpenCSGs:mainfrom
sabhi128:feat-space-handler-tests
Open

test(render): add unit tests for SpaceHandlerImpl#1535
sabhi128 wants to merge 1 commit into
OpenCSGs:mainfrom
sabhi128:feat-space-handler-tests

Conversation

@sabhi128

Copy link
Copy Markdown
Contributor

Summary of Changes

This PR expands backend test coverage by adding unit tests for SpaceHandlerImpl under internal/handlers/render/.

Changes:

  • New File: internal/handlers/render/spaces_test.go
    • Added route rendering coverage for:
      1. List route (spaces_index template rendering).
      2. Detail route (parameter mapping of namespace and space_name to spaces_show template).
      3. New route (checks context layout and license dictionary injection matching DefaultLicensesJSON).

All rendering calls are tested in isolation using Mockery's testifying mocks.

Copilot AI lite review requested due to automatic review settings August 28, 2026 10:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR expands backend rendering handler test coverage by adding a unit test suite for SpaceHandlerImpl in internal/handlers/render/, following the existing pattern used for other resource handlers (e.g., models).

Changes:

  • Added spaces_test.go to verify SpaceHandlerImpl.List renders spaces_index.
  • Added coverage for SpaceHandlerImpl.Detail to ensure namespace and spaceName are correctly mapped into the spaces_show template data.
  • Added coverage for SpaceHandlerImpl.New to ensure licenses is injected as DefaultLicensesJSON when rendering spaces_new.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants