import { Editor } from "@tiptap/react"; import { StarterKit } from "@tiptap/starter-kit"; import { describe, expect, it } from "vitest"; import { NotebookTextDirection, setTextDirection } from "./text-direction"; describe("notebook text direction", () => { it("persists right-to-left direction in the notebook HTML", () => { const editor = new Editor({ content: "
יש לי 16GB
", extensions: [StarterKit, NotebookTextDirection], }); setTextDirection(editor, "rtl").run(); expect(editor.getHTML()).toBe('יש לי 16GB
'); editor.destroy(); }); it("reads and changes an existing direction attribute", () => { const editor = new Editor({ content: '