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

   <!-- Make sure the base branch is `rocketmq-studio`: that is the RocketMQ 
Studio trunk. -->
   
   ### Which Issue(s) This PR Fixes
   
   <!-- Link the issue with a keyword so it closes on merge. Trivial fixes need 
no issue.
        
https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue
 -->
   
   - Fixes #4036
   
   ### Brief Description
   
   <!-- What changes and why. Keep it short — the diff already shows how. -->
   
   Add direct regression coverage for `isMockMode()` using the real data-mode 
store.
   
   The tests cover runtime toggles from both initial modes and persisted 
browser preferences that differ from the build default. Each case reuses the 
same imported service function during toggles, verifying that it reads the 
current state on every call.
   
   Only `web/src/services/dataMode.test.ts` is added; no runtime code, 
dependencies, lockfiles, or CI changes are included. Existing store tests are 
preserved.
   
   Earlier PR #4075 was closed without being merged.
   
   AI assistance was used for this change. The diff was reviewed and the checks 
below were executed.
   
   ### How Did You Test This Change?
   
   <!-- Paste the commands you ran and what they printed. Typical verification:
        backend  `cd server && mvn -B -ntp test`   (integration tests need 
MySQL 8, see CONTRIBUTING.md)
        frontend `cd web && npm test && npm run lint && npm run build`
        A pull request with no verification will not be merged. -->
   
   Validated in a fresh worktree based on upstream `rocketmq-studio`.
   
   In `web`, using Windows Node:
   
   - `node node_modules/vitest/vitest.mjs run src/services/dataMode.test.ts 
src/stores/dataModeStore.test.ts`: 2 test files passed, 8 tests passed (4 new 
service tests and 4 existing store tests); exit code 0.
   - `node node_modules/typescript/bin/tsc -b`: no output; exit code 0.
   - `node node_modules/eslint/bin/eslint.js src/services/dataMode.test.ts`: no 
output; exit code 0.
   - `node node_modules/prettier/bin/prettier.cjs --check 
src/services/dataMode.test.ts`: formatting check passed; exit code 0.
   - Mutation check: temporarily changed the service to return the state cached 
at module import. All 4 new tests failed with assertion errors. The original 
source was restored byte-for-byte, and all 8 focused tests passed again.
   
   At the repository root:
   
   - `git diff --check upstream/rocketmq-studio...HEAD`: no output; exit code 0.
   - `git diff --stat upstream/rocketmq-studio...HEAD`: only 
`web/src/services/dataMode.test.ts`, with 64 insertions.
   - `git status --short`: no output; working tree clean.
   
   The pre-commit ESLint and Prettier checks passed. Full test suites, 
production builds, and backend architecture checks were not run.
   
   The new test file carries the ASF license header. UI translations and 
behavior documentation updates are not applicable to this test-only change.
   
   ### Checklist
   
   - [x] One coherent change; unrelated modifications are not bundled in
   - [x] Commit subject follows Conventional Commits (`feat:` / `fix:` / 
`refactor:` / `chore:` / `docs:` / `perf:`)
   - [x] Tests added or updated for non-trivial changes, test methods named 
`...Test`
   - [ ] New UI text has both Chinese and English entries under `web/src/i18n/`
   - [ ] Architecture constraints stay green (`mvn test` runs the ArchUnit 
checks)
   - [x] New source files carry the ASF license header
   - [ ] Documentation touched where behaviour changed (README / `docs/` / 
in-app help)


-- 
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