File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ export function EmptyBlock(props: EmptyBlockProps): JSX.Element {
5757 ) }
5858 onClick = { ( ) => sendAddInstanceEvent ( ) }
5959 type = "button"
60+ data-testid = "visual-builder__empty-block-add-button"
6061 >
6162 < i className = "fas fa-plus" > </ i >
6263 { blockParentName }
Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ import {
4242import { useHighlightCommentIcon } from "./eventManager/useHighlightCommentIcon" ;
4343import { updateHighlightedCommentIconPosition } from "./generators/generateHighlightedComment" ;
4444import { useRecalculateVariantDataCSLPValues } from "./eventManager/useRecalculateVariantDataCSLPValues" ;
45+ import { VB_EmptyBlockParentClass } from ".." ;
4546
4647interface VisualBuilderGlobalStateImpl {
4748 previousSelectedEditableDOM : HTMLElement | Element | null ;
@@ -184,7 +185,7 @@ export class VisualBuilder {
184185 ) ;
185186 const emptyBlockParents = Array . from (
186187 document . querySelectorAll (
187- ".visual-builder__empty-block-parent"
188+ `. ${ VB_EmptyBlockParentClass } `
188189 )
189190 ) ;
190191
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import { FieldSchemaMap } from "../utils/fieldSchemaMap";
2121import { isFieldDisabled } from "../utils/isFieldDisabled" ;
2222import EventListenerHandlerParams from "./types" ;
2323import { toggleHighlightedCommentIconDisplay } from "../generators/generateHighlightedComment" ;
24+ import { VB_EmptyBlockParentClass } from "../.." ;
2425
2526type HandleBuilderInteractionParams = Omit <
2627 EventListenerHandlerParams ,
@@ -110,7 +111,7 @@ async function handleBuilderInteraction(
110111 // if the selected element is our empty block element, return
111112 if (
112113 editableElement . classList . contains (
113- "visual-builder__empty-block-parent"
114+ VB_EmptyBlockParentClass
114115 ) ||
115116 editableElement . classList . contains ( "visual-builder__empty-block" )
116117 ) {
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import EventListenerHandlerParams from "./types";
1010import { VisualBuilder } from ".." ;
1111import { addHoverOutline } from "../generators/generateHoverOutline" ;
1212import { visualBuilderStyles } from "../visualBuilder.style" ;
13+ import { VB_EmptyBlockParentClass } from "../.." ;
1314
1415export interface HandleMouseHoverParams
1516 extends Pick <
@@ -202,7 +203,7 @@ async function handleMouseHover(params: HandleMouseHoverParams): Promise<void> {
202203
203204 if (
204205 ! editableElement . classList . contains (
205- "visual-builder__empty-block-parent"
206+ VB_EmptyBlockParentClass
206207 ) &&
207208 ! editableElement . classList . contains ( "visual-builder__empty-block" )
208209 ) {
You can’t perform that action at this time.
0 commit comments