Merged
Conversation
Closed
Contributor
There was a problem hiding this comment.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Now that they're split off of the main component per #36 they're a lot easier to test :)