Skip to content

move to production - #3704

Merged
Baalmart merged 26 commits into
masterfrom
staging
Jun 28, 2026
Merged

move to production#3704
Baalmart merged 26 commits into
masterfrom
staging

Conversation

@Baalmart

@Baalmart Baalmart commented Jun 28, 2026

Copy link
Copy Markdown
Collaborator

Codebmk and others added 24 commits June 28, 2026 15:12
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.
@coderabbitai

coderabbitai Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 120dea4d-eca8-4b1a-9b8b-ec35ef4b8eef

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch staging

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Baalmart
Baalmart requested a review from Psalmz777 June 28, 2026 18:07
@Baalmart
Baalmart merged commit 5f1e34d into master Jun 28, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants