test: add component tests for DashboardLayout, DataTable, Combobox, MilestoneTimeline, ShipmentSummaryPrint - #1
Open
Raven062 wants to merge 1 commit into
Open
Conversation
…ilestoneTimeline, ShipmentSummaryPrint (Navin-xmr#739 Navin-xmr#740 Navin-xmr#741)
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 issues Navin-xmr#739, Navin-xmr#740, Navin-xmr#741
Adds component tests with zero previous coverage for five components:
DashboardLayout.tsxsrc/components/layout/DashboardLayout.test.tsxDataTable.tsx(common)src/components/common/DataTable/DataTable.test.tsxCombobox.tsxsrc/components/ui/Combobox.test.tsxMilestoneTimeline.tsxsrc/components/shipment/MilestoneTimeline/MilestoneTimeline.test.tsxShipmentSummaryPrint.tsxsrc/components/shipment/ShipmentSummaryPrint/ShipmentSummaryPrint.test.tsxWhat's covered
DashboardLayout — initial render, nav items, Outlet rendering, active route highlighting, sidebar collapse/expand, nav group accordion, favorites (add/remove/persist/restore from localStorage), mobile sidebar dialog (role=dialog, aria-modal), keyboard shortcuts modal, enterprise node status widget.
DataTable — column headers, data rows, loading skeleton, empty state with CTA, sorting (asc/desc/reset, numeric, non-sortable columns), row click callback, pagination (page buttons, aria-current, prev/next disabled states, item range summary).
Combobox — initial render, controlled value, opening dropdown, filtering (case-insensitive), option selection (onChange + onSelectOption), keyboard navigation (ArrowDown/Up/Enter/Escape), clear button, loading state, disabled state, outside click.
MilestoneTimeline — render, filter pills (All/Completed/In Progress/Upcoming), empty state after filtering, clear filter, zoom controls (in/out/disabled at limits/reset), expandable milestone details (notes, sensor readings), blockchain link for completed milestones.
ShipmentSummaryPrint — portal rendering, all metadata fields (id, status, sender, receiver, tracking, carrier, priority, dates), milestone table, cost breakdown, payment info, sensor snapshot, notes, delivery proof, Stellar TX hash, print+close lifecycle (window.print called after 200 ms delay, onClose fired once).
Testing approach
window.printandHTMLElement.prototype.scrollIntoViewstubbed for jsdom compatibilityWhat was tested
pnpm run testrun locally; all five new test files pass.