ultisuite-client/lib/drive/richtext-content.test.ts
R3D347HR4Y 8e420509a8
Some checks are pending
E2E / Playwright e2e (push) Waiting to run
imports docx 1
2026-06-10 00:27:44 +02:00

21 lines
571 B
TypeScript

import assert from "node:assert/strict"
import { describe, it } from "node:test"
import { isEmptyTipTapDoc } from "./richtext-content.ts"
describe("richtext-content", () => {
it("detects empty TipTap documents", () => {
assert.equal(isEmptyTipTapDoc(undefined), true)
assert.equal(
isEmptyTipTapDoc({ type: "doc", content: [{ type: "paragraph" }] }),
true
)
assert.equal(
isEmptyTipTapDoc({
type: "doc",
content: [{ type: "paragraph", content: [{ type: "text", text: "Hello" }] }],
}),
false
)
})
})