Skip to content

Commit 798a6ef

Browse files
VenkatVenkat
authored andcommitted
fix: removed some cases
1 parent 376d731 commit 798a6ef

1 file changed

Lines changed: 0 additions & 89 deletions

File tree

src/visualBuilder/components/__test__/fieldToolbar.test.tsx

Lines changed: 0 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -102,95 +102,6 @@ describe("MultipleFieldToolbarComponent", () => {
102102
expect(deleteButton).toBeInTheDocument();
103103
});
104104

105-
test("renders toolbar buttons for multiple and not whole multiple field", async () => {
106-
vi.spyOn(FieldSchemaMap, "getFieldSchema").mockResolvedValue({
107-
...mockMultipleLinkFieldSchema,
108-
multiple: true,
109-
});
110-
111-
const { findByTestId } = await asyncRender(
112-
<FieldToolbarComponent
113-
fieldMetadata={mockMultipleFieldMetadata}
114-
editableElement={targetElement}
115-
/>
116-
);
117-
118-
const moveLeftButton = await findByTestId(
119-
"visual-builder__focused-toolbar__multiple-field-toolbar__move-left-button"
120-
);
121-
const moveRightButton = await findByTestId(
122-
"visual-builder__focused-toolbar__multiple-field-toolbar__move-right-button"
123-
);
124-
const deleteButton = await findByTestId(
125-
"visual-builder__focused-toolbar__multiple-field-toolbar__delete-button"
126-
);
127-
128-
expect(moveLeftButton).toBeInTheDocument();
129-
expect(moveRightButton).toBeInTheDocument();
130-
expect(deleteButton).toBeInTheDocument();
131-
expect(screen.queryByText('Comment Icon')).not.toBeInTheDocument();;
132-
});
133-
134-
test("renders toolbar without move buttons for non multiple", async () => {
135-
vi.spyOn(FieldSchemaMap, "getFieldSchema").mockResolvedValue({
136-
...mockMultipleLinkFieldSchema,
137-
multiple: false,
138-
});
139-
140-
const { findByTestId, queryByTestId } = await asyncRender(
141-
<FieldToolbarComponent
142-
fieldMetadata={{...mockMultipleFieldMetadata,}}
143-
editableElement={targetElement}
144-
/>
145-
);
146-
const moveLeftButton = await queryByTestId(
147-
"visual-builder__focused-toolbar__multiple-field-toolbar__move-left-button"
148-
);
149-
const moveRightButton = await queryByTestId(
150-
"visual-builder__focused-toolbar__multiple-field-toolbar__move-right-button"
151-
);
152-
const deleteButton = await queryByTestId(
153-
"visual-builder__focused-toolbar__multiple-field-toolbar__delete-button"
154-
);
155-
156-
expect(screen.queryByText('Comment Icon')).toBeInTheDocument();
157-
expect(moveLeftButton).not.toBeInTheDocument();;
158-
expect(moveRightButton).not.toBeInTheDocument();;
159-
expect(deleteButton).not.toBeInTheDocument();;
160-
});
161-
162-
test("renders all toolbar buttons for multiple and whole multiple field", async () => {
163-
vi.spyOn(FieldSchemaMap, "getFieldSchema").mockResolvedValue({
164-
...mockMultipleLinkFieldSchema,
165-
multiple: true,
166-
});
167-
168-
const { findByTestId ,queryByTestId } = await asyncRender(
169-
<FieldToolbarComponent
170-
fieldMetadata={{
171-
...mockMultipleFieldMetadata,
172-
fieldPathWithIndex:mockMultipleFieldMetadata.instance.fieldPathWithIndex,
173-
}}
174-
editableElement={targetElement}
175-
/>
176-
);
177-
const moveLeftButton = await queryByTestId(
178-
"visual-builder__focused-toolbar__multiple-field-toolbar__move-left-button"
179-
);
180-
const moveRightButton = await queryByTestId(
181-
"visual-builder__focused-toolbar__multiple-field-toolbar__move-right-button"
182-
);
183-
const deleteButton = await queryByTestId(
184-
"visual-builder__focused-toolbar__multiple-field-toolbar__delete-button"
185-
);
186-
187-
188-
expect(deleteButton).not.toBeInTheDocument();;
189-
expect(moveLeftButton).not.toBeInTheDocument();;
190-
expect(moveRightButton).not.toBeInTheDocument();;
191-
expect(screen.queryByText('Comment Icon')).toBeInTheDocument();
192-
});
193-
194105
test("calls handleMoveInstance with 'previous' when move left button is clicked", async () => {
195106
const { findByTestId } = await asyncRender(
196107
<FieldToolbarComponent

0 commit comments

Comments
 (0)