Skip to content

Commit

Permalink
Merge pull request #5777 from gooddata/ine-dropzone-test-classes
Browse files Browse the repository at this point in the history
test: add test classes to the dropzones
  • Loading branch information
ivanmjartan authored Jan 9, 2025
2 parents 7f67fa7 + 26fd7cb commit 88e01e7
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// (C) 2022-2024 GoodData Corporation
// (C) 2022-2025 GoodData Corporation
import cx from "classnames";
import React, { useCallback, useEffect, useRef, useMemo } from "react";

Expand Down Expand Up @@ -126,9 +126,15 @@ export const Hotspot: React.FC<IHotspotProps> = (props) => {
[isEndingHotspot, layoutPath],
);

const pathItems = layoutPath
? layoutPath.map((pathItem) => `-${pathItem.sectionIndex}_${pathItem.itemIndex}`).join("")
: "";

const testClass = layoutPath ? `s-dropzone${pathItems}` : undefined;

return (
<div
className={cx(classNames, "dropzone", dropZoneType, {
className={cx(classNames, "dropzone", dropZoneType, testClass, {
hidden: !canDrop || !canDropSafe(item),
full: isEndingHotspot,
active: isOver,
Expand Down

0 comments on commit 88e01e7

Please sign in to comment.