dify/web/app/components/workflow/run/get-hovered-parallel-id.ts
CodingOnStar 3d10cf97f1 test: add unit tests for various workflow components
- 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.
2026-03-25 12:12:59 +08:00

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
}