SinhSinhAn commented on PR #3377:
URL: 
https://github.com/apache/apisix-dashboard/pull/3377#issuecomment-4273003702

   @Baoyuantop Thanks for the review! I've added unit tests for the 
`discovery_args` schema fix.
   
   Since the project didn't have a unit test framework, I added Vitest (which 
integrates seamlessly with the existing Vite setup) and created 4 test cases in 
`src/types/schema/apisix/upstreams.test.ts`:
   
   1. **Preserves flat key-value pairs** - verifies `group_name`, 
`namespace_id` survive parsing
   2. **Preserves nested values** - verifies complex objects like `{ metadata: 
{ version: "v1" } }` are kept
   3. **Accepts empty `discovery_args`** - `{}` passes validation
   4. **Accepts missing `discovery_args`** - `undefined` is valid (optional 
field)
   
   All 4 tests pass. Run with: `npx vitest run 
src/types/schema/apisix/upstreams.test.ts`


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