Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

873 B
Raw Blame
/* Copyright 2026 Marimo. All rights reserved. */

import { fireEvent, render, screen } from "@testing-library/react";
import { expect, it } from "vitest";
import { DraggablePopover } from "../draggable-popover";

it("moves from the keyboard handle without intercepting child input arrows", () => {
  render(
    <DraggablePopover open={true}>
      <input aria-label="Filter" />
    </DraggablePopover>,
  );
  const handle = screen.getByRole("button", {
    name: "Move popup with arrow keys",
  });
  const popup = screen.getByRole("dialog");
  fireEvent.keyDown(handle, { key: "ArrowRight" });
  fireEvent.keyDown(handle, { key: "ArrowDown" });
  expect(popup).toHaveStyle({ left: "10px", top: "10px" });
  expect(
    fireEvent.keyDown(screen.getByRole("textbox"), { key: "ArrowLeft" }),
  ).toBe(true);
  expect(popup).toHaveStyle({ left: "10px", top: "10px" });
});