mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-08-23 14:52:18 +10:00
fix(web): restore Tiptap Enter and list editing
This commit is contained in:
@@ -48,13 +48,13 @@
|
||||
"@tanstack/react-hotkeys": "^0.10.0",
|
||||
"@tanstack/react-query": "^5.101.4",
|
||||
"@tanstack/react-router": "^1.170.18",
|
||||
"@tiptap/extension-color": "^3.29.1",
|
||||
"@tiptap/extension-highlight": "^3.29.1",
|
||||
"@tiptap/extension-text-align": "^3.29.1",
|
||||
"@tiptap/extension-text-style": "^3.29.1",
|
||||
"@tiptap/pm": "^3.29.1",
|
||||
"@tiptap/react": "^3.29.1",
|
||||
"@tiptap/starter-kit": "^3.29.1",
|
||||
"@tiptap/extension-color": "^3.29.2",
|
||||
"@tiptap/extension-highlight": "^3.29.2",
|
||||
"@tiptap/extension-text-align": "^3.29.2",
|
||||
"@tiptap/extension-text-style": "^3.29.2",
|
||||
"@tiptap/pm": "^3.29.2",
|
||||
"@tiptap/react": "^3.29.2",
|
||||
"@tiptap/starter-kit": "^3.29.2",
|
||||
"@types/js-cookie": "^3.0.6",
|
||||
"@uiw/color-convert": "^2.10.3",
|
||||
"@uiw/react-color-colorful": "^2.10.3",
|
||||
|
||||
@@ -1,6 +1,33 @@
|
||||
// @vitest-environment happy-dom
|
||||
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { Editor } from "@tiptap/react";
|
||||
import StarterKit from "@tiptap/starter-kit";
|
||||
import { resolveHighlightToolbarState } from "./rich-input.utils";
|
||||
|
||||
describe("Tiptap editing", () => {
|
||||
it("creates a new paragraph when Enter is pressed", () => {
|
||||
const editor = new Editor({ extensions: [StarterKit], content: "<p>First</p>" });
|
||||
|
||||
editor.commands.setTextSelection(editor.state.doc.content.size - 1);
|
||||
editor.commands.enter();
|
||||
|
||||
expect(editor.getHTML()).toBe("<p>First</p><p></p>");
|
||||
editor.destroy();
|
||||
});
|
||||
|
||||
it("creates and splits list items", () => {
|
||||
const editor = new Editor({ extensions: [StarterKit], content: "<p>First</p>" });
|
||||
|
||||
editor.commands.setTextSelection(editor.state.doc.content.size - 1);
|
||||
editor.commands.toggleBulletList();
|
||||
editor.commands.enter();
|
||||
|
||||
expect(editor.getHTML()).toBe("<ul><li><p>First</p></li><li><p></p></li></ul><p></p>");
|
||||
editor.destroy();
|
||||
});
|
||||
});
|
||||
|
||||
describe("resolveHighlightToolbarState", () => {
|
||||
it("shows legacy colorless highlights as default yellow and clearable", () => {
|
||||
expect(resolveHighlightToolbarState(true, null)).toEqual({
|
||||
|
||||
Reference in New Issue
Block a user