Skip to content

Conversation

rijkvanzanten
Copy link
Member

Now that they're split off of the main component per #36 they're a lot easier to test :)

@rijkvanzanten rijkvanzanten requested a review from Copilot August 26, 2025 22:33
Copilot

This comment was marked as outdated.

@rijkvanzanten rijkvanzanten requested a review from Copilot August 26, 2025 22:44
@rijkvanzanten rijkvanzanten linked an issue Aug 26, 2025 that may be closed by this pull request
Copy link
Contributor

@Copilot 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

This PR adds comprehensive unit tests for the Vue split panel composables (useSizes, useResize, usePointer, useKeyboard, useGridTemplate) that were recently extracted from the main component. The tests improve code coverage and validate the behavior of these reusable functions.

  • Adds test files for 5 composables covering size calculations, resize handling, pointer interactions, keyboard navigation, and grid template generation
  • Updates existing test files to use data-testid attributes instead of CSS class selectors for more reliable test targeting
  • Makes minSize parameter optional in the useSizes composable interface

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/vue-split-panel/tests/mounting.test.ts Updates selectors to use data-testid attributes
packages/vue-split-panel/tests/collapse.test.ts Updates selectors to use data-testid attributes
packages/vue-split-panel/src/composables/use-sizes.ts Makes minSize parameter optional in interface
packages/vue-split-panel/src/composables/use-sizes.test.ts Adds comprehensive tests for size calculations and conversions
packages/vue-split-panel/src/composables/use-resize.ts Exports onResize callback for testing
packages/vue-split-panel/src/composables/use-resize.test.ts Adds tests for resize observer behavior
packages/vue-split-panel/src/composables/use-pointer.test.ts Adds tests for pointer interactions and double-click handling
packages/vue-split-panel/src/composables/use-keyboard.test.ts Adds tests for keyboard navigation functionality
packages/vue-split-panel/src/composables/use-grid-template.test.ts Adds tests for CSS grid template generation
packages/vue-split-panel/src/SplitPanel.vue Adds data-testid attributes to DOM elements

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

It has a default value
@rijkvanzanten rijkvanzanten merged commit c0c2ea1 into main Aug 26, 2025
2 checks passed
@rijkvanzanten rijkvanzanten deleted the rijk/11 branch August 27, 2025 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant