Conversation
Add comprehensive unit tests for proxyConfig, vertex-config, useContextAwareRouting, api-routing, and utils to improve coverage and validate edge cases. Refactor useContextAwareRouting by extracting isRouteAccessible into a standalone exported helper and update the hook to call it with the sidebar config, making routing logic easier to test and reuse. Tests include environment mocking and logger stubs for validateProxyConfig and various cases for API URL resolution, path versioning, class name utilities, and elapsed duration calculations.
Add comprehensive unit tests for core hooks (useBannerWithDelay, useClipboard, useCohorts, useDevices, useGroups, usePermissions, useRecentlyVisited, useRoles, useServerSideTableState, useSites, useUserContext, useWindow). Introduce test helpers and mocks: renderWithProviders, renderHookWithProviders, createTestQueryClient, and setupStore (configuring relevant Redux slices). Also add simple test factories (device, organization, user) and various API/adapter/permission/banner mocks to standardize the testing environment and improve coverage for hook behavior.
Replace the inline reducer object with a combined `rootReducer` using Redux Toolkit's `combineReducers`. Adds the `combineReducers` import and constructs a single root reducer from user, sites, devices, grids, cohorts, and groups slices before passing it to `configureStore`. This centralizes reducer composition and makes extending or replacing reducers easier in tests and runtime.
Update useBannerWithDelay test to expect the banner payload to include severity: "info". The assertion in src/vertex/core/hooks/useBannerWithDelay.test.tsx now checks for { message: "Second", severity: "info" }, reflecting the banner payload change to include a default severity.
Add Vitest + React Testing Library unit tests for multiple shared and UI components. New tests cover shared components (ReusableButton, ReusableFileUpload, ReusableInputField, ReusableSelectInput, ReusableTable, ReusableToast, CardWrapper) and many UI primitives (accordion, alert, avatar, badge, banner, button, calendar, card, checkbox, combobox, command, date-picker, dialog, dropdown-menu, empty-state, form, input, label, popover, progress, select, skeleton, switch, tabs, textarea, tooltip). Tests assert accessibility roles, user interactions, and component states; and include necessary mocks for browser APIs (clipboard, PointerEvent, ResizeObserver, scrollIntoView) and app contexts (next/navigation, banner-context) to stabilize JSDOM test runs.
Add comprehensive Vitest + React Testing Library unit tests for various UI components under src/vertex/components/ui. Tests cover ErrorBoundary, alert dialog, chart container, collapsible, custom dialog, forbidden error/page, hcaptcha widget, hover card, multi-select, pagination, permission tooltip, scroll area, select field, separator, sheet, sonner/toaster, stepper, table, and toast. Includes necessary test-time mocks/stubs (ResizeObserver, PointerEvent, next/navigation, react-redux, env constants, tooltip/provider, next-themes, use-toast) and uses userEvent for interaction tests to validate rendering and basic behaviors.
Modify ReusableTable to use a plain <style> tag (remove styled-jsx) and remove the defaultProps block. Update several unit tests: ErrorBoundary test now prevents & cleans up window error events to avoid noisy logs; chart test imports vi, mocks recharts' ResponsiveContainer and wraps ChartContainer in a sized div to stabilize rendering; custom-dialog test adds Dialog title/description nodes; stepper test simplifies children to plain spans and removes unused StepTitle/StepDescription imports. These changes address test stability and clean up component defaults.
Add comprehensive unit tests and test utilities for core services and utils. New tests cover network-service (axios/fetch flows, errors, timeouts), onboardingService (secureApiProxy patch calls), proxyClient (request forwarding, auth/api token injection, error handling), secureApiProxyClient (axios interceptors, token handling, response error behavior), and platform (Mac architecture detection fallbacks). Also add test factories (apiResponseFactory) for mocking Axios/Fetch responses and next-auth mocks (nextAuth) to simplify session and server-session stubbing.
Refactor multiple UI test files to improve TypeScript types and remove unused imports. Replaced broad any casts with stricter types (unknown, never, Record<string, unknown>, and React.ReactNode) including vi.importActual typing and mock component props. Unified MockPointerEvent assignment to window.PointerEvent as never and adjusted ReusableTable test to use String(val) and a never cast for columns. Also removed unused imports (AvatarImage, Banner variants, userEvent) and added typed Tooltip mocks to reduce TS errors and improve type safety across tests.
Extract repeated JSDOM/window mock setup into a new test utility (src/vertex/test/utils/domMocks.ts) exposing setupPointerEventMock and setupResizeObserverMock. Replace inline MockPointerEvent/ResizeObserver and HTMLElement overrides across multiple UI tests (chart, combobox, date-picker, dialog, dropdown-menu, multi-select, popover, select) with imports and calls to the new utilities. The helpers install mocks in beforeAll and restore originals in afterAll to keep tests isolated and reduce duplication.
Wrap render and assertions in a try/finally block so window error listener removal and console.error mock restoration always run. This prevents leaking global state and makes the ErrorBoundary test more robust if render or assertions throw.
Delete the entire src/internal-docs module which contained the Mariana Deep (BookStack) deployment and configuration. Removed files include .env.example, .gitignore, README.md, docker-compose.yml, the k8s Helm chart (Chart.yaml), templates (helpers, configmap, deployments, services, pvc, secret, hpa), and values-prod.yaml. Cleans up obsolete/internal documentation deployment artifacts.
chore: remove internal docs project
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Feature: Core Component & Service API Test Coverage (vertex app)
Codebmk
approved these changes
Jun 28, 2026
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.
Uh oh!
There was an error while loading. Please reload this page.