Skip to content

Conversation

@stemangiola
Copy link
Owner

Add unit tests for get_x_y_annotation_columns as a prerequisite for feature development.

Co-authored-by: mangiolastefano <mangiolastefano@gmail.com>
@stemangiola stemangiola requested a review from Copilot July 6, 2025 05:14
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds comprehensive unit tests for get_x_y_annotation_columns to validate its behavior across various data scenarios.

  • Introduces helper functions to generate basic and complex test datasets
  • Covers empty, single-row, grouped, list, factor, numeric, real-world-like, and edge-case inputs
  • Verifies output structure, column orientations, and annotation filtering
Comments suppressed due to low confidence (2)

tests/testthat/test-get_x_y_annotation_columns.R:66

  • [nitpick] Test descriptions use mixed casing and phrasing. Standardize all test_that descriptions (e.g., consistently start with the function name in backticks) for better readability.
test_that("get_x_y_annotation_columns handles complex data correctly", {

tests/testthat/test-get_x_y_annotation_columns.R:293

  • Consider adding negative tests for invalid inputs (e.g., non-existent x, y, or abundance columns) to verify that the function raises appropriate errors.
})
stemangiola and others added 4 commits July 6, 2025 14:47
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- Updated the get_x_y_annotation_columns function to improve column orientation handling and ensure the abundance column is included in both orientations.
- Refactored test cases to use the tidyHeatmap namespace and added tests for boolean row-specific annotations in rectangular data.
- Improved test data creation for better clarity and consistency across various scenarios.
…-50e5' of https://github.com/stemangiola/tidyHeatmap into cursor/create-unit-tests-for-get-x-y-annotation-columns-50e5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants