Skip to content

Commit a7a0d53

Browse files
test: wrap attribute checks in waitFor for visual builder tests
1 parent 3e1eb9e commit a7a0d53

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

src/visualBuilder/__test__/index.test.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,10 @@ describe("Visual builder", () => {
190190
test("single line should be contenteditable", async () => {
191191
await triggerAndWaitForClickAction(visualBuilderPostMessage, h1);
192192

193-
expect(h1).toHaveAttribute("contenteditable");
194-
expect(h1).toHaveAttribute("data-cslp-field-type", "singleline");
193+
await waitFor(() => {
194+
expect(h1).toHaveAttribute("contenteditable");
195+
expect(h1).toHaveAttribute("data-cslp-field-type", "singleline");
196+
})
195197
}, { timeout: 20 * 1000 });
196198

197199
test("multi line should be contenteditable", async () => {
@@ -201,8 +203,10 @@ describe("Visual builder", () => {
201203
);
202204
await triggerAndWaitForClickAction(visualBuilderPostMessage, h1);
203205

204-
expect(h1).toHaveAttribute("contenteditable");
205-
expect(h1).toHaveAttribute("data-cslp-field-type", "multiline");
206+
await waitFor(() => {
207+
expect(h1).toHaveAttribute("contenteditable");
208+
expect(h1).toHaveAttribute("data-cslp-field-type", "multiline");
209+
})
206210
}, { timeout: 20 * 1000 });
207211

208212
});

0 commit comments

Comments
 (0)