test(ui): add unit tests for DropdownMenu and Select primitives - #1377
Merged
yusuftomilola merged 1 commit intoAug 26, 2026
Merged
Conversation
Covers DropdownMenu open/close, item onClick with auto-close, asChild trigger mode, and Select value reflection, onChange, className, ref forwarding, plus compound components (SelectTrigger, SelectValue, SelectContent, SelectItem). Total: 14 tests across 2 spec files. Closes DistinctCodes#1307
|
@ameeribro4-sudo is attempting to deploy a commit to the naijabuz's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@ameeribro4-sudo Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
yusuftomilola
approved these changes
Aug 26, 2026
yusuftomilola
left a comment
Collaborator
There was a problem hiding this comment.
No merge conflicts with main. Good unit test coverage for DropdownMenu and Select primitives - approving.
3 tasks
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.
Summary
Closes #1307
Closes #1304
Closes #1305
Closes #1306
Adds unit tests for the
DropdownMenuandSelectUI primitives infrontend/components/ui/— two components used across the topbar user menu, list-view sort/filter controls, and various form selects, with no prior test coverage.Why
These primitives are foundational UI building blocks that handle keyboard-adjacent interactions (click to open, click to close, value reflection). Without tests, a regression in the open/close toggle or the
asChildpass-through could break the topbar menu or any form select without being caught by the test suite.What was built
frontend/components/ui/dropdown-menu.test.tsx:frontend/components/ui/select.test.tsx:defaultValuereflected in elementNo existing files modified — only additions, so regression risk is low.
Acceptance criteria coverage
Test plan
npm testinfrontend/— 14/14 passing (all new tests for this feature)Env vars / Notes
No new environment variables. Tests use
@testing-library/reactwithjest-environment-jsdomper the existingfrontend/jest.config.js.