import { expect, it } from "vitest"
import { createFormattingHandlers } from "@/lib/formatting-handlers"

it("creates handlers that safely handle null view", () => {
  const view = null
  const h = createFormattingHandlers(() => view)
  expect(h.isActive("bold")).toBe(false)
  expect(h.getActiveHeading()).toBeNull()
  // doesn't throw
  h.toggleBold()
})
