-
Notifications
You must be signed in to change notification settings - Fork 6
test: add tests for composables #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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
Now that they're split off of the main component per #36 they're a lot easier to test :)