yyqdbngt opened a new pull request, #4075:
URL: https://github.com/apache/rocketmq-dashboard/pull/4075

   Fixes #4036
   
   
   ## Summary
   
   Adds a focused Vitest regression test file at 
`web/src/services/__tests__/dataMode.test.ts` covering the runtime data-mode 
service. The test locks the current behavior of `isMockMode()` from 
`web/src/services/dataMode.ts`: it reads the `useMock` flag from the runtime 
Zustand store (`web/src/stores/dataModeStore.ts`), so toggling the store state 
at runtime is reflected immediately.
   
   Note: the issue skeleton's source path placed the service under 
`web/src/pages/studio/`; in this repository the service actually lives at 
`web/src/services/dataMode.ts`, so the test file is placed next to it under 
`web/src/services/__tests__/` and imports the store via 
`../../stores/dataModeStore` (matching the issue's `TestFile` location).
   
   ## Why
   
   The existing suite does not cover the runtime data-mode service. A 
regression here would make the mock/real data mode diverge from the runtime 
store flag, so the bridge is locked with a dedicated test file. No runtime 
behavior changes are made.
   
   ## Testing
   
   - Local type check: `cd web && ./node_modules/.bin/tsc -b tsconfig.app.json` 
(exit 0).
   - Targeted Vitest run: `cd web && ./node_modules/.bin/vitest run 
src/services/__tests__/dataMode.test.ts` (all tests pass).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to