CJstate opened a new pull request, #21807:
URL: https://github.com/apache/echarts/pull/21807

   ## Purpose
   
   Adds a Jest unit test covering the vertical-orient handle-label separation 
on `visualMap[type='continuous']` with `calculable: true` — the case reported 
in #21766 and discussed there as missing coverage ("The existing overlap cases 
in test/visualMap-continuous.html are horizontal only").
   
   The push-apart behavior itself was implemented in #21586 and refined in 
06cd2ea5 (post-6.1.0, currently only covered by horizontal visual cases). This 
PR locks it in with logic-level assertions that CI runs on every change.
   
   ## What the test does
   
   `test/ut/spec/component/visualMap/continuousLabelOverlap.test.ts` renders a 
vertical calculable continuous visualMap over a heatmap with three handle 
ranges:
   
   - `[50, 50]` — both handles at the same position (the exact reported case)
   - `[49, 51]` — handles one unit apart
   - `[0, 100]` — handles at opposite ends (control case: separation logic must 
not misfire)
   
   For each range it asserts:
   
   1. Both handle labels exist (`_shapes.handleLabels` from the ContinuousView).
   2. Their bounding rects are vertically disjoint — after the push-apart, 
neither label's rect intersects the other's.
   3. Their y positions differ (the 6.1.0 bug stacked both labels at the exact 
same point).
   
   The test reaches into the view via 
`ecIns._componentsMap[vmModel.__viewId]._shapes.handleLabels`, following the 
same pattern other UTs use for private view state.
   
   ## How tested
   
   - `npx jest --config test/ut/jest.config.cjs 
test/ut/spec/component/visualMap/continuousLabelOverlap.test.ts` → 3 passed.
   - Full suite: `npx jest --config test/ut/jest.config.cjs` → **28 suites / 
199 tests passed**, no regressions.
   
   ## Notes
   
   No runtime code is touched — this is coverage-only, so it is safe to land 
regardless of release timing.
   


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to