Skip to content

test(render): add unit tests for NotebookHandlerImpl - #1540

Open
sabhi128 wants to merge 2 commits into
OpenCSGs:mainfrom
sabhi128:feat-notebook-handler-tests
Open

test(render): add unit tests for NotebookHandlerImpl#1540
sabhi128 wants to merge 2 commits into
OpenCSGs:mainfrom
sabhi128:feat-notebook-handler-tests

Conversation

@sabhi128

Copy link
Copy Markdown
Contributor

Summary of Changes

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

Changes:

  • New File: internal/handlers/render/notebooks_test.go
    • Added route rendering coverage for:
      1. List route (notebooks_index template rendering).
      2. Show route (parameter mapping of notebook_id, path, and custom layout configuration options to notebooks_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, and redundant response code assertions have been removed.

Copilot AI lite review requested due to automatic review settings August 29, 2026 09:14

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 adds backend unit test coverage for NotebookHandlerImpl in internal/handlers/render/, validating that key notebook routes invoke the expected templates with the expected rendering data.

Changes:

  • Added a new test suite covering List, Show, and New behaviors for NotebookHandlerImpl.
  • Validated template name selection (notebooks_index, notebooks_show, notebooks_new) and critical data mapping (e.g., notebookId, trimmed path, isSmallFooter, and licenses).

💡 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