test: fix mermaid test flake (#7249)

This commit is contained in:
David Luzar 2023-11-07 18:06:15 +01:00 committed by GitHub
parent 9006caff39
commit 3c96943db3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -1,4 +1,4 @@
import { act, fireEvent, render } from "./test-utils";
import { act, fireEvent, render, waitFor } from "./test-utils";
import { Excalidraw } from "../packages/excalidraw/index";
import React from "react";
import { expect, vi } from "vitest";
@ -111,7 +111,7 @@ describe("Test <MermaidToExcalidraw/>", () => {
it("should open mermaid popup when active tool is mermaid", async () => {
const dialog = document.querySelector(".dialog-mermaid")!;
await waitFor(() => dialog.querySelector("canvas"));
expect(dialog.outerHTML).toMatchSnapshot();
});