yyqdbngt opened a new pull request, #3874: URL: https://github.com/apache/rocketmq-dashboard/pull/3874
### Motivation The `browserStorage` helpers only had two tests: a happy-path round trip and a blanket all-operations-throw case. This PR grows the suite to eight cases that pin down the failure semantics callers depend on. ### Changes - An empty-string value round-trips as stored (`''`), never confused with an absent key. - Keys stay isolated: removing one does not disturb the others. - Removing an absent key is a successful no-op. - A failing `getItem` does not poison later writes/removes, and a `QuotaExceededError` on `setItem` reports failure while reads and removes keep working. - When the `localStorage` global itself is unavailable the helpers fall back safely (`null`/`false`). - Existing all-operations-throw fallback assertions are preserved. ### Verification - `vitest run src/utils/browserStorage.test.ts`: 8/8 passed - `tsc --noEmit`: clean - `eslint src/utils/browserStorage.test.ts`: clean -- 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]
