Skip to content

Commit d25210f

Browse files
VenkatVenkat
authored andcommitted
fix: code cleaning
1 parent 9da12c6 commit d25210f

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ vi.mock("../../utils/instanceHandlers", () => ({
1515
handleDeleteInstance: vi.fn(),
1616
}));
1717

18+
//CommentIcon testcases are covered seperatly
1819
vi.mock("../CommentIcon", () => ({
1920
default: vi.fn(() => <div>Comment Icon</div>)
2021
}));
@@ -127,7 +128,7 @@ describe("MultipleFieldToolbarComponent", () => {
127128
expect(moveLeftButton).toBeInTheDocument();
128129
expect(moveRightButton).toBeInTheDocument();
129130
expect(deleteButton).toBeInTheDocument();
130-
expect(screen.queryByText('Comment Icon')).toBeNull();
131+
expect(screen.queryByText('Comment Icon')).not.toBeInTheDocument();;
131132
});
132133

133134
test("renders toolbar without move buttons for non multiple", async () => {
@@ -153,9 +154,9 @@ describe("MultipleFieldToolbarComponent", () => {
153154
);
154155

155156
expect(screen.queryByText('Comment Icon')).toBeInTheDocument();
156-
expect(moveLeftButton).toBeNull();
157-
expect(moveRightButton).toBeNull();
158-
expect(deleteButton).toBeNull();
157+
expect(moveLeftButton).not.toBeInTheDocument();;
158+
expect(moveRightButton).not.toBeInTheDocument();;
159+
expect(deleteButton).not.toBeInTheDocument();;
159160
});
160161

161162
test("renders all toolbar buttons for multiple and whole multiple field", async () => {
@@ -187,9 +188,9 @@ describe("MultipleFieldToolbarComponent", () => {
187188
);
188189

189190

190-
expect(deleteButton).toBeNull();
191-
expect(moveLeftButton).toBeNull();
192-
expect(moveRightButton).toBeNull();
191+
expect(deleteButton).not.toBeInTheDocument();;
192+
expect(moveLeftButton).not.toBeInTheDocument();;
193+
expect(moveRightButton).not.toBeInTheDocument();;
193194
expect(screen.queryByText('Comment Icon')).toBeInTheDocument();
194195
});
195196

0 commit comments

Comments
 (0)