Skip to content

Conversation

@fasteiner
Copy link
Owner

Summary

This PR introduces comprehensive unit test coverage for all public Notion block constructors, including complex and nested blocks such as tables, media (image/video), synced blocks, and annotations. Tests validate both typical and edge-case inputs, ensuring robust parameter validation and consistent object generation.

Additionally:

  • Refactored internal constructors (e.g., Bookmark, Code) for consistency and correctness.
  • Added verbose/debug logging to aid test diagnostics.
  • Fixed multiple incorrect test assertions and structure mismatches.
  • Suppressed Pester naming warnings across test modules.

Rich text utilities received focused testing and minor improvements to conversion and annotation logic.

fasteiner and others added 3 commits September 25, 2025 16:38
…commands

Add unit tests for Notion block creation commands
Fixes #36
Refactor tests and implement new rich text functions
- Updated test files to disable name checking for Pester module.
- Removed commented-out tests and added new tests for Notion ToDo block, including color handling and checked state.
- Implemented New-NotionRichTextText and New-NotionRichTextEquation functions with detailed parameter handling and annotations.
- Added comprehensive tests for rich text classes, ensuring correct behavior for text and equation structures.
- Improved parameter validation in rich text functions and ensured proper output types.

Co-authored-by: Fabian Franz Steiner <fasteiner@users.noreply.github.com>
@fasteiner fasteiner linked an issue Sep 25, 2025 that may be closed by this pull request
@fasteiner fasteiner merged commit e1ae086 into main Sep 25, 2025
1 check failed
@fasteiner fasteiner deleted the feature/36-pester-tests-for-block-functions branch September 25, 2025 21:44
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.

Pester Tests for Block Functions

3 participants