mirror of
https://github.com/langgenius/dify.git
synced 2026-05-11 14:58:23 +08:00
- Introduced new test files for CandidateNodeMain, CustomEdge, NodeContextmenu, PanelContextmenu, HelpLine, and several hooks. - Each test file includes comprehensive tests to validate component rendering, interactions, and state management. - Enhanced test coverage for dynamic test run options and data source configurations. - Ensured proper mocking of dependencies to isolate component behavior during tests.
11 lines
342 B
TypeScript
11 lines
342 B
TypeScript
export const getHoveredParallelId = (relatedTarget: EventTarget | null) => {
|
|
const element = relatedTarget as Element | null
|
|
if (element && 'closest' in element) {
|
|
const closestParallel = element.closest('[data-parallel-id]')
|
|
if (closestParallel)
|
|
return closestParallel.getAttribute('data-parallel-id')
|
|
}
|
|
|
|
return null
|
|
}
|