Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion frontend/src/components/editor/__tests__/cell-renders.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Copyright 2026 Marimo. All rights reserved. */
import { act, render } from "@testing-library/react";
import { act, fireEvent, render, screen, within } from "@testing-library/react";
import { Profiler } from "react";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { DocumentWrapper } from "@/__mocks__/document";
Expand Down Expand Up @@ -66,6 +66,22 @@ async function setup(count: number) {
return { ...notebook, replica, renders };
}

it("shares the tooltip hover delay across cells", async () => {
await setup(2);
const [first, second] = screen
.getAllByTestId("cell-tray")
.map((tray) => within(tray).getByRole("button", { name: "Delete cell" }));

fireEvent.pointerMove(first, { pointerType: "mouse" });
expect(first).toHaveAttribute("data-state", "closed");
await act(async () => vi.advanceTimersByTimeAsync(400));
expect(first).toHaveAttribute("data-state", "delayed-open");

fireEvent.pointerLeave(first, { pointerType: "mouse" });
fireEvent.pointerMove(second, { pointerType: "mouse" });
expect(second).toHaveAttribute("data-state", "instant-open");
});

describe.each([2, 25])("cell render isolation with %i cells", (count) => {
it("does not re-render other cells on a keystroke", async () => {
const { store, model, renders } = await setup(count);
Expand Down
Loading
Loading