Skip to content

Commit

Permalink
Use fixture.events.sleep() in the failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
Swanand01 committed Apr 8, 2024
1 parent bc342d7 commit dfaaf80
Showing 1 changed file with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,20 +124,19 @@ describe('Quick Actions integration', () => {
});

it(`clicking the \`${ACTIONS.INSERT_TEXT.text}\` button should select the background, open the text tab in the library and insert the default text`, async () => {
await waitFor(async () => {
// click quick menu button
await fixture.events.click(
fixture.editor.canvas.quickActionMenu.insertTextButton
);
expect(fixture.editor.canvas.framesLayer.frames.length).toBe(2);
expect(
fixture.editor.sidebar.designPanel.selectionSection
).not.toBeNull();
// click quick menu button
await fixture.events.click(
fixture.editor.canvas.quickActionMenu.insertTextButton
);
await fixture.events.sleep(100);
expect(fixture.editor.canvas.framesLayer.frames.length).toBe(2);
expect(
fixture.editor.sidebar.designPanel.selectionSection
).not.toBeNull();

expect(document.activeElement).toEqual(
fixture.editor.canvas.framesLayer.frames[1].node
);
});
expect(document.activeElement).toEqual(
fixture.editor.canvas.framesLayer.frames[1].node
);
});

it('should allow clicking multiple actions', async () => {
Expand Down

0 comments on commit dfaaf80

Please sign in to comment.