Skip to content

Commit c05998b

Browse files
test: update failing tests
1 parent 638637b commit c05998b

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

src/visualBuilder/generators/__test__/generateToolbar.test.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,23 +39,23 @@ describe("generateToolbar", () => {
3939
});
4040

4141
describe("appendFieldToolbar", () => {
42-
it("should render FieldToolbarComponent if not already present", () => {
43-
appendFieldToolbar(eventDetails, focusedToolbarElement, hideOverlay);
42+
it("should render FieldToolbarComponent if not already present", async () => {
43+
await appendFieldToolbar(eventDetails, focusedToolbarElement, hideOverlay);
4444

4545
expect(render).toBeCalled();
4646
});
4747

48-
it("should not render FieldToolbarComponent if already present", () => {
48+
it("should not render FieldToolbarComponent if already present", async () => {
4949
focusedToolbarElement.innerHTML =
5050
'<div class="visual-builder__focused-toolbar__multiple-field-toolbar"></div>';
5151

52-
appendFieldToolbar(eventDetails, focusedToolbarElement, hideOverlay);
52+
await appendFieldToolbar(eventDetails, focusedToolbarElement, hideOverlay);
5353

5454
expect(render).not.toHaveBeenCalled();
5555
});
5656

57-
it("should append the rendered component to the focusedToolbarElement", () => {
58-
appendFieldToolbar(eventDetails, focusedToolbarElement, hideOverlay);
57+
it("should append the rendered component to the focusedToolbarElement", async () => {
58+
await appendFieldToolbar(eventDetails, focusedToolbarElement, hideOverlay);
5959

6060
expect(spyAppend).toHaveBeenCalledWith(expect.any(DocumentFragment));
6161
});

vitest.setup.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ beforeAll(() => {
1818
vi.mock("./src/visualBuilder/utils/getEntryPermissionsCached", () => {
1919
return {
2020
getEntryPermissionsCached: vi.fn().mockResolvedValue({
21+
read: true,
22+
publish: true,
2123
update: true,
24+
delete: true,
2225
}),
2326
};
2427
});

0 commit comments

Comments
 (0)