Skip to content

Add comprehensive test suite for response and UI components#53

Draft
f3l1x wants to merge 1 commit intomasterfrom
claude/add-more-tests-xVk9I
Draft

Add comprehensive test suite for response and UI components#53
f3l1x wants to merge 1 commit intomasterfrom
claude/add-more-tests-xVk9I

Conversation

@f3l1x
Copy link
Copy Markdown
Member

@f3l1x f3l1x commented Mar 29, 2026

This PR adds a comprehensive test suite covering multiple response types and UI components in the Contributte Application library.

Summary

Added 7 new test files with extensive test coverage for response classes and UI components, ensuring proper functionality of PSR-7 stream responses, file responses with adapters, image responses, and null components.

Key Changes

  • PSR7StreamResponse tests: Validates default/custom content types, getters, stream output, and empty stream handling
  • FlyFileResponse tests: Tests adapter integration, content type configuration, filename changes, and download disposition settings
  • StdoutAdapter tests: Verifies buffer writing, callback parameter passing, and output generation
  • ProcessAdapter tests: Tests command execution, custom buffer sizes, and multi-line output handling
  • ImageResponse tests: Validates constructor with Image instances, file paths, error handling, and custom type/quality parameters
  • NullComponent tests: Confirms instantiation and proper inheritance from Nette Component

Notable Implementation Details

  • Tests use mock implementations (e.g., anonymous StreamInterface class) to avoid external dependencies
  • Comprehensive coverage of both success paths and edge cases (empty streams, non-existent files)
  • Tests verify proper parameter passing between components and adapters
  • Output buffering used to validate stream and process output

https://claude.ai/code/session_01JpmfUCxQwgqBnP1KzzbGLL

Add tests for PSR7StreamResponse, ImageResponse, FlyFileResponse,
ProcessAdapter, StdoutAdapter, and NullComponent.

https://claude.ai/code/session_01JpmfUCxQwgqBnP1KzzbGLL
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 29, 2026

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

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