@fluidframework/react 2.90.0 → 2.92.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/api-report/react.alpha.api.md +8 -8
- package/lib/alpha.d.ts +1 -1
- package/lib/beta.d.ts +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/public.d.ts +1 -1
- package/lib/reactSharedTreeView.d.ts +6 -6
- package/lib/reactSharedTreeView.d.ts.map +1 -1
- package/lib/reactSharedTreeView.js +16 -18
- package/lib/reactSharedTreeView.js.map +1 -1
- package/lib/test/reactSharedTreeView.spec.js +3 -3
- package/lib/test/reactSharedTreeView.spec.js.map +1 -1
- package/lib/test/text/textEditor.test.js +89 -676
- package/lib/test/text/textEditor.test.js.map +1 -1
- package/lib/test/useObservation.spec.js +8 -8
- package/lib/test/useObservation.spec.js.map +1 -1
- package/lib/test/useTree.spec.js +15 -15
- package/lib/test/useTree.spec.js.map +1 -1
- package/lib/text/index.d.ts +3 -2
- package/lib/text/index.d.ts.map +1 -1
- package/lib/text/index.js +1 -2
- package/lib/text/index.js.map +1 -1
- package/lib/text/plain/index.d.ts +1 -1
- package/lib/text/plain/index.d.ts.map +1 -1
- package/lib/text/plain/index.js +1 -1
- package/lib/text/plain/index.js.map +1 -1
- package/lib/text/plain/plainTextView.d.ts +6 -3
- package/lib/text/plain/plainTextView.d.ts.map +1 -1
- package/lib/text/plain/plainTextView.js +16 -21
- package/lib/text/plain/plainTextView.js.map +1 -1
- package/lib/text/plain/plainUtils.d.ts +1 -0
- package/lib/text/plain/plainUtils.d.ts.map +1 -1
- package/lib/text/plain/plainUtils.js +1 -0
- package/lib/text/plain/plainUtils.js.map +1 -1
- package/lib/useObservation.js +6 -6
- package/lib/useObservation.js.map +1 -1
- package/lib/useTree.d.ts +7 -7
- package/lib/useTree.d.ts.map +1 -1
- package/lib/useTree.js +6 -6
- package/lib/useTree.js.map +1 -1
- package/package.json +16 -17
- package/react.test-files.tar +0 -0
- package/src/index.ts +1 -9
- package/src/reactSharedTreeView.tsx +11 -13
- package/src/text/index.ts +3 -10
- package/src/text/plain/index.ts +1 -1
- package/src/text/plain/plainTextView.tsx +7 -7
- package/src/text/plain/plainUtils.ts +1 -0
- package/src/useObservation.ts +6 -6
- package/src/useTree.ts +19 -12
- package/tsconfig.json +0 -6
- package/lib/test/mochaHooks.js +0 -13
- package/lib/test/mochaHooks.js.map +0 -1
- package/lib/text/formatted/index.d.ts +0 -6
- package/lib/text/formatted/index.d.ts.map +0 -1
- package/lib/text/formatted/index.js +0 -6
- package/lib/text/formatted/index.js.map +0 -1
- package/lib/text/formatted/quillFormattedView.d.ts +0 -54
- package/lib/text/formatted/quillFormattedView.d.ts.map +0 -1
- package/lib/text/formatted/quillFormattedView.js +0 -426
- package/lib/text/formatted/quillFormattedView.js.map +0 -1
- package/lib/text/plain/quillView.d.ts +0 -22
- package/lib/text/plain/quillView.d.ts.map +0 -1
- package/lib/text/plain/quillView.js +0 -112
- package/lib/text/plain/quillView.js.map +0 -1
- package/src/text/formatted/index.ts +0 -11
- package/src/text/formatted/quillFormattedView.tsx +0 -509
- package/src/text/plain/quillView.tsx +0 -149
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textEditor.test.js","sourceRoot":"","sources":["../../../src/test/text/textEditor.test.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,qBAAqB,EAAiB,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,WAAW,MAAM,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AC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { strict as assert } from \"node:assert\";\n\nimport { TreeViewConfiguration, type TreeView } from \"@fluidframework/tree\";\nimport { TreeAlpha } from \"@fluidframework/tree/alpha\";\nimport { independentView, TextAsTree } from \"@fluidframework/tree/internal\";\nimport { render } from \"@testing-library/react\";\nimport globalJsdom from \"global-jsdom\";\nimport DeltaPackage from \"quill-delta\";\nimport * as React from \"react\";\n\nimport { toPropTreeNode } from \"../../propNode.js\";\nimport {\n\tclipboardFormatMatcher,\n\tFormattedTextAsTree,\n\tFormattedMainView,\n\ttype FormattedEditorHandle,\n\tparseCssFontFamily,\n\tparseCssFontSize,\n\t// Allow import of files being tested\n\t// eslint-disable-next-line import-x/no-internal-modules\n} from \"../../text/formatted/quillFormattedView.js\";\nimport {\n\tPlainTextMainView,\n\tQuillMainView,\n\ttype MainViewProps,\n\t// Allow import of files being tested\n\t// eslint-disable-next-line import-x/no-internal-modules\n} from \"../../text/plain/index.js\";\nimport { UndoRedoStacks } from \"../../undoRedo.js\";\n\n// Workaround for quill-delta's export style not working well with node16 module resolution.\ntype Delta = DeltaPackage.default;\nconst Delta = DeltaPackage.default;\n\n// Configuration for creating formatted text views\nconst formattedTreeConfig = new TreeViewConfiguration({ schema: FormattedTextAsTree.Tree });\n\n/**\n * Creates a TreeView for formatted text, initialized with the provided initial value.\n */\nfunction createFormattedTreeView(initialValue = \"\"): {\n\ttree: FormattedTextAsTree.Tree;\n} {\n\tconst treeView = independentView(formattedTreeConfig);\n\ttreeView.initialize(FormattedTextAsTree.Tree.fromString(initialValue));\n\treturn { tree: treeView.root };\n}\n\n/**\n * Creates a TreeView for formatted text with events access (needed for undo/redo tests).\n */\nfunction createFormattedTreeViewWithEvents(\n\tinitialValue = \"\",\n): TreeView<typeof FormattedTextAsTree.Tree> {\n\tconst treeView = independentView(formattedTreeConfig);\n\ttreeView.initialize(FormattedTextAsTree.Tree.fromString(initialValue));\n\treturn treeView;\n}\n\nconst views: { name: string; component: React.FC<MainViewProps> }[] = [\n\t{ name: \"Quill\", component: QuillMainView },\n\t{ name: \"Plain TextArea\", component: PlainTextMainView },\n];\n\n// TODO add collaboration tests when rich formatting is supported using TestContainerRuntimeFactory from\n// @fluidframework/test-utils to test rich formatting data sync between multiple collaborators\ndescribe(\"textEditor\", () => {\n\t// Note: JSDOM is initialized once in mochaHooks.ts before Quill is imported,\n\t// since Quill requires document at import time. See src/test/mochaHooks.ts.\n\t// These tests reset up a clean DOM.\n\n\tlet cleanup: () => void;\n\n\t// TODO: why does making this beforeEach/afterEach instead of before/after cause cleanup to crash?\n\t// It seems like each test should be able to have its own clean DOM.\n\tbefore(() => {\n\t\tcleanup = globalJsdom();\n\t});\n\n\tafter(() => {\n\t\tcleanup();\n\t});\n\n\t// Loop through all registered views\n\tfor (const view of views) {\n\t\tdescribe(`${view.name} view`, () => {\n\t\t\tdescribe(\"dom tests\", () => {\n\t\t\t\t// Run without strict mode to make sure it works in a normal production setup.\n\t\t\t\t// Run with strict mode to potentially detect additional issues.\n\t\t\t\tfor (const reactStrictMode of [false, true]) {\n\t\t\t\t\tdescribe(`StrictMode: ${reactStrictMode}`, () => {\n\t\t\t\t\t\tconst ViewComponent = view.component;\n\n\t\t\t\t\t\tit(\"renders MainView with editor container\", () => {\n\t\t\t\t\t\t\tconst text = TextAsTree.Tree.fromString(\"\");\n\t\t\t\t\t\t\tconst content = <ViewComponent root={toPropTreeNode(text)} />;\n\t\t\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\n\t\t\t\t\t\t\tassert.match(\n\t\t\t\t\t\t\t\trendered.baseElement.textContent ?? \"\",\n\t\t\t\t\t\t\t\t/Collaborative Text Editor/,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tit(\"renders MainView with initial text content\", () => {\n\t\t\t\t\t\t\tconst text = TextAsTree.Tree.fromString(\"Hello World\");\n\t\t\t\t\t\t\tconst content = <ViewComponent root={toPropTreeNode(text)} />;\n\t\t\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\n\t\t\t\t\t\t\tassert.match(rendered.baseElement.textContent ?? \"\", /Hello World/);\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tit(\"invalidates view when tree is mutated\", () => {\n\t\t\t\t\t\t\tconst text = TextAsTree.Tree.fromString(\"Hello\");\n\t\t\t\t\t\t\tconst content = <ViewComponent root={toPropTreeNode(text)} />;\n\t\t\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\n\t\t\t\t\t\t\t// Mutate the tree by inserting text\n\t\t\t\t\t\t\ttext.insertAt(5, \" World\");\n\n\t\t\t\t\t\t\t// Rerender and verify the view updates\n\t\t\t\t\t\t\trendered.rerender(content);\n\t\t\t\t\t\t\tassert.match(rendered.baseElement.textContent ?? \"\", /Hello World/);\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tit(\"invalidates view when text is removed\", () => {\n\t\t\t\t\t\t\tconst text = TextAsTree.Tree.fromString(\"Hello World\");\n\t\t\t\t\t\t\tconst content = <ViewComponent root={toPropTreeNode(text)} />;\n\t\t\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\n\t\t\t\t\t\t\t// Mutate the tree by removing \" World\" (indices 5 to 11)\n\t\t\t\t\t\t\ttext.removeRange(5, 11);\n\n\t\t\t\t\t\t\t// Rerender and verify the view updates\n\t\t\t\t\t\t\trendered.rerender(content);\n\t\t\t\t\t\t\tassert.match(rendered.baseElement.textContent ?? \"\", /Hello/);\n\t\t\t\t\t\t\tassert(rendered.baseElement.textContent !== null);\n\t\t\t\t\t\t\tassert.doesNotMatch(rendered.baseElement.textContent, /World/);\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tit(\"invalidates view when text is cleared and replaced\", () => {\n\t\t\t\t\t\t\tconst text = TextAsTree.Tree.fromString(\"Original\");\n\t\t\t\t\t\t\tconst content = <ViewComponent root={toPropTreeNode(text)} />;\n\t\t\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\n\t\t\t\t\t\t\t// Clear all text\n\t\t\t\t\t\t\tconst length = [...text.characters()].length;\n\t\t\t\t\t\t\ttext.removeRange(0, length);\n\n\t\t\t\t\t\t\t// Insert new text\n\t\t\t\t\t\t\ttext.insertAt(0, \"Replaced\");\n\n\t\t\t\t\t\t\t// Rerender and verify the view updates\n\t\t\t\t\t\t\trendered.rerender(content);\n\t\t\t\t\t\t\tassert.match(rendered.baseElement.textContent ?? \"\", /Replaced/);\n\t\t\t\t\t\t\tassert(rendered.baseElement.textContent !== null);\n\t\t\t\t\t\t\tassert.doesNotMatch(rendered.baseElement.textContent, /Original/);\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\t// Tests for surrogate pair characters (emojis use 2 UTF-16 code units)\n\t\t\t\t\t\t// These verify correct handling where editor indexing may differ from iteration.\n\n\t\t\t\t\t\tit(\"renders MainView with surrogate pair characters\", () => {\n\t\t\t\t\t\t\t// 😀 is a surrogate pair: \"😀\".length === 2, but [...\"😀\"].length === 1\n\t\t\t\t\t\t\tconst text = TextAsTree.Tree.fromString(\"Hello 😀 World\");\n\t\t\t\t\t\t\tconst content = <ViewComponent root={toPropTreeNode(text)} />;\n\t\t\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\n\t\t\t\t\t\t\tassert.match(rendered.baseElement.textContent ?? \"\", /Hello 😀 World/);\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tit(\"inserts text after surrogate pair characters\", () => {\n\t\t\t\t\t\t\tconst text = TextAsTree.Tree.fromString(\"A😀B\");\n\t\t\t\t\t\t\tconst content = <ViewComponent root={toPropTreeNode(text)} />;\n\t\t\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\n\t\t\t\t\t\t\t// Insert after the emoji (index 2 in character count: A, 😀, B)\n\t\t\t\t\t\t\ttext.insertAt(2, \"X\");\n\n\t\t\t\t\t\t\trendered.rerender(content);\n\t\t\t\t\t\t\tassert.match(rendered.baseElement.textContent ?? \"\", /A😀XB/);\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tit(\"removes surrogate pair characters\", () => {\n\t\t\t\t\t\t\tconst text = TextAsTree.Tree.fromString(\"A😀B\");\n\t\t\t\t\t\t\tconst content = <ViewComponent root={toPropTreeNode(text)} />;\n\t\t\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\n\t\t\t\t\t\t\t// Remove the emoji (index 1, length 1 in character count)\n\t\t\t\t\t\t\ttext.removeRange(1, 2);\n\n\t\t\t\t\t\t\trendered.rerender(content);\n\t\t\t\t\t\t\tassert.match(rendered.baseElement.textContent ?? \"\", /AB/);\n\t\t\t\t\t\t\tassert(rendered.baseElement.textContent !== null);\n\t\t\t\t\t\t\tassert.doesNotMatch(rendered.baseElement.textContent, /😀/);\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tit(\"handles multiple surrogate pair characters\", () => {\n\t\t\t\t\t\t\tconst text = TextAsTree.Tree.fromString(\"👋🌍🎉\");\n\t\t\t\t\t\t\tconst content = <ViewComponent root={toPropTreeNode(text)} />;\n\t\t\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\n\t\t\t\t\t\t\t// Insert between emojis\n\t\t\t\t\t\t\ttext.insertAt(2, \"!\");\n\n\t\t\t\t\t\t\trendered.rerender(content);\n\t\t\t\t\t\t\tassert.match(rendered.baseElement.textContent ?? \"\", /👋🌍!🎉/);\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\t// Formatted text view tests - Initial view rendering (matching plain text test structure)\n\tdescribe(\"Formatted Quill view\", () => {\n\t\tdescribe(\"dom tests\", () => {\n\t\t\tfor (const reactStrictMode of [false, true]) {\n\t\t\t\tdescribe(`StrictMode: ${reactStrictMode}`, () => {\n\t\t\t\t\tit(\"renders FormattedMainView with editor container\", () => {\n\t\t\t\t\t\tconst { tree } = createFormattedTreeView();\n\t\t\t\t\t\tconst content = <FormattedMainView root={toPropTreeNode(tree)} />;\n\t\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\n\t\t\t\t\t\tassert.match(\n\t\t\t\t\t\t\trendered.baseElement.textContent ?? \"\",\n\t\t\t\t\t\t\t/Collaborative Formatted Text Editor/,\n\t\t\t\t\t\t);\n\t\t\t\t\t});\n\n\t\t\t\t\tit(\"renders FormattedMainView with initial text content\", () => {\n\t\t\t\t\t\tconst { tree } = createFormattedTreeView(\"Hello World\");\n\t\t\t\t\t\tconst content = <FormattedMainView root={toPropTreeNode(tree)} />;\n\t\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\n\t\t\t\t\t\tassert.match(rendered.baseElement.textContent ?? \"\", /Hello World/);\n\t\t\t\t\t});\n\n\t\t\t\t\tit(\"invalidates view when tree is mutated\", () => {\n\t\t\t\t\t\tconst { tree: text } = createFormattedTreeView(\"Hello\");\n\t\t\t\t\t\tconst content = <FormattedMainView root={toPropTreeNode(text)} />;\n\t\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\n\t\t\t\t\t\t// Mutate the tree by inserting text\n\t\t\t\t\t\ttext.insertAt(5, \" World\");\n\n\t\t\t\t\t\t// Rerender and verify the view updates\n\t\t\t\t\t\trendered.rerender(content);\n\t\t\t\t\t\tassert.match(rendered.baseElement.textContent ?? \"\", /Hello World/);\n\t\t\t\t\t});\n\n\t\t\t\t\tit(\"invalidates view when text is removed\", () => {\n\t\t\t\t\t\tconst { tree: text } = createFormattedTreeView(\"Hello World\");\n\t\t\t\t\t\tconst content = <FormattedMainView root={toPropTreeNode(text)} />;\n\t\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\n\t\t\t\t\t\t// Mutate the tree by removing \" World\" (indices 5 to 11)\n\t\t\t\t\t\ttext.removeRange(5, 11);\n\n\t\t\t\t\t\t// Rerender and verify the view updates\n\t\t\t\t\t\trendered.rerender(content);\n\t\t\t\t\t\tassert.match(rendered.baseElement.textContent ?? \"\", /Hello/);\n\t\t\t\t\t\tassert(rendered.baseElement.textContent !== null);\n\t\t\t\t\t\tassert.doesNotMatch(rendered.baseElement.textContent, /World/);\n\t\t\t\t\t});\n\n\t\t\t\t\tit(\"invalidates view when text is cleared and replaced\", () => {\n\t\t\t\t\t\tconst { tree: text } = createFormattedTreeView(\"Original\");\n\t\t\t\t\t\tconst content = <FormattedMainView root={toPropTreeNode(text)} />;\n\t\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\n\t\t\t\t\t\t// Clear all text\n\t\t\t\t\t\tconst length = [...text.characters()].length;\n\t\t\t\t\t\ttext.removeRange(0, length);\n\n\t\t\t\t\t\t// Insert new text\n\t\t\t\t\t\ttext.insertAt(0, \"Replaced\");\n\n\t\t\t\t\t\t// Rerender and verify the view updates\n\t\t\t\t\t\trendered.rerender(content);\n\t\t\t\t\t\tassert.match(rendered.baseElement.textContent ?? \"\", /Replaced/);\n\t\t\t\t\t\tassert(rendered.baseElement.textContent !== null);\n\t\t\t\t\t\tassert.doesNotMatch(rendered.baseElement.textContent, /Original/);\n\t\t\t\t\t});\n\n\t\t\t\t\t// Tests for surrogate pair characters (emojis use 2 UTF-16 code units)\n\t\t\t\t\t// These verify correct handling where editor indexing may differ from iteration.\n\n\t\t\t\t\tit(\"renders FormattedMainView with surrogate pair characters\", () => {\n\t\t\t\t\t\t// 😀 is a surrogate pair: \"😀\".length === 2, but [...\"😀\"].length === 1\n\t\t\t\t\t\tconst { tree: text } = createFormattedTreeView(\"Hello 😀 World\");\n\t\t\t\t\t\tconst content = <FormattedMainView root={toPropTreeNode(text)} />;\n\t\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\n\t\t\t\t\t\tassert.match(rendered.baseElement.textContent ?? \"\", /Hello 😀 World/);\n\t\t\t\t\t});\n\n\t\t\t\t\tit(\"inserts text after surrogate pair characters\", () => {\n\t\t\t\t\t\tconst { tree: text } = createFormattedTreeView(\"A😀B\");\n\t\t\t\t\t\tconst content = <FormattedMainView root={toPropTreeNode(text)} />;\n\t\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\n\t\t\t\t\t\t// Insert after the emoji (index 2 in character count: A, 😀, B)\n\t\t\t\t\t\ttext.insertAt(2, \"X\");\n\n\t\t\t\t\t\trendered.rerender(content);\n\t\t\t\t\t\tassert.match(rendered.baseElement.textContent ?? \"\", /A😀XB/);\n\t\t\t\t\t});\n\n\t\t\t\t\tit(\"removes surrogate pair characters\", () => {\n\t\t\t\t\t\tconst { tree: text } = createFormattedTreeView(\"A😀B\");\n\t\t\t\t\t\tconst content = <FormattedMainView root={toPropTreeNode(text)} />;\n\t\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\n\t\t\t\t\t\t// Remove the emoji (index 1, length 1 in character count)\n\t\t\t\t\t\ttext.removeRange(1, 2);\n\n\t\t\t\t\t\trendered.rerender(content);\n\t\t\t\t\t\tassert.match(rendered.baseElement.textContent ?? \"\", /AB/);\n\t\t\t\t\t\tassert(rendered.baseElement.textContent !== null);\n\t\t\t\t\t\tassert.doesNotMatch(rendered.baseElement.textContent, /😀/);\n\t\t\t\t\t});\n\n\t\t\t\t\tit(\"handles multiple surrogate pair characters\", () => {\n\t\t\t\t\t\tconst { tree: text } = createFormattedTreeView(\"👋🌍🎉\");\n\t\t\t\t\t\tconst content = <FormattedMainView root={toPropTreeNode(text)} />;\n\t\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\n\t\t\t\t\t\t// Insert between emojis\n\t\t\t\t\t\ttext.insertAt(2, \"!\");\n\n\t\t\t\t\t\trendered.rerender(content);\n\t\t\t\t\t\tassert.match(rendered.baseElement.textContent ?? \"\", /👋🌍!🎉/);\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\t// Helper to create default format\n\t\tfunction createPlainFormat(): FormattedTextAsTree.CharacterFormat {\n\t\t\treturn new FormattedTextAsTree.CharacterFormat({\n\t\t\t\tbold: false,\n\t\t\t\titalic: false,\n\t\t\t\tunderline: false,\n\t\t\t\tsize: 12,\n\t\t\t\tfont: \"Arial\",\n\t\t\t});\n\t\t}\n\n\t\t// Essential tests for character attributes\n\t\t// Each attribute needs: insert, delete, and formatRange tests\n\t\tdescribe(\"character attribute tests\", () => {\n\t\t\tfor (const reactStrictMode of [false, true]) {\n\t\t\t\tdescribe(`StrictMode: ${reactStrictMode}`, () => {\n\t\t\t\t\tit(\"delete on empty string does not throw\", () => {\n\t\t\t\t\t\tconst { tree: text } = createFormattedTreeView();\n\t\t\t\t\t\tconst content = <FormattedMainView root={toPropTreeNode(text)} />;\n\t\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\n\t\t\t\t\t\tassert.doesNotThrow(() => {\n\t\t\t\t\t\t\ttext.removeRange(0, 0);\n\t\t\t\t\t\t\trendered.rerender(content);\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\n\t\t\t\t\tdescribe(\"bold\", () => {\n\t\t\t\t\t\tit(\"inserts bold text and renders with <strong> tag\", () => {\n\t\t\t\t\t\t\tconst { tree: text } = createFormattedTreeView(\"Hello\");\n\t\t\t\t\t\t\tconst content = <FormattedMainView root={toPropTreeNode(text)} />;\n\t\t\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\n\t\t\t\t\t\t\tassert.ok(!rendered.container.querySelector(\"strong\"), \"Initially: no <strong>\");\n\n\t\t\t\t\t\t\ttext.defaultFormat = new FormattedTextAsTree.CharacterFormat({\n\t\t\t\t\t\t\t\tbold: true,\n\t\t\t\t\t\t\t\titalic: false,\n\t\t\t\t\t\t\t\tunderline: false,\n\t\t\t\t\t\t\t\tsize: 12,\n\t\t\t\t\t\t\t\tfont: \"Arial\",\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\ttext.insertAt(2, \"BOLD\");\n\n\t\t\t\t\t\t\trendered.rerender(content);\n\t\t\t\t\t\t\tconst el = rendered.container.querySelector(\"strong\");\n\t\t\t\t\t\t\tassert.ok(el, \"Expected <strong> tag\");\n\t\t\t\t\t\t\tassert.match(el.textContent ?? \"\", /BOLD/);\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tit(\"deletes bold text and removes <strong> tag\", () => {\n\t\t\t\t\t\t\tconst { tree: text } = createFormattedTreeView();\n\t\t\t\t\t\t\ttext.defaultFormat = new FormattedTextAsTree.CharacterFormat({\n\t\t\t\t\t\t\t\tbold: true,\n\t\t\t\t\t\t\t\titalic: false,\n\t\t\t\t\t\t\t\tunderline: false,\n\t\t\t\t\t\t\t\tsize: 12,\n\t\t\t\t\t\t\t\tfont: \"Arial\",\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\ttext.insertAt(0, \"BOLD\");\n\t\t\t\t\t\t\ttext.defaultFormat = createPlainFormat();\n\t\t\t\t\t\t\ttext.insertAt(4, \"plain\");\n\n\t\t\t\t\t\t\tconst content = <FormattedMainView root={toPropTreeNode(text)} />;\n\t\t\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\n\t\t\t\t\t\t\tassert.ok(rendered.container.querySelector(\"strong\"), \"Initially: has <strong>\");\n\n\t\t\t\t\t\t\ttext.removeRange(0, 4);\n\t\t\t\t\t\t\trendered.rerender(content);\n\n\t\t\t\t\t\t\tassert.ok(\n\t\t\t\t\t\t\t\t!rendered.container.querySelector(\"strong\"),\n\t\t\t\t\t\t\t\t\"After delete: no <strong>\",\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tit(\"applies bold via formatRange\", () => {\n\t\t\t\t\t\t\tconst { tree: text } = createFormattedTreeView(\"Hello World\");\n\t\t\t\t\t\t\tconst content = <FormattedMainView root={toPropTreeNode(text)} />;\n\t\t\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\n\t\t\t\t\t\t\ttext.formatRange(6, 11, { bold: true });\n\t\t\t\t\t\t\trendered.rerender(content);\n\n\t\t\t\t\t\t\tconst el = rendered.container.querySelector(\"strong\");\n\t\t\t\t\t\t\tassert.ok(el, \"Expected <strong> after formatRange\");\n\t\t\t\t\t\t\tassert.match(el.textContent ?? \"\", /World/);\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\n\t\t\t\t\tdescribe(\"italic\", () => {\n\t\t\t\t\t\tit(\"inserts italic text and renders with <em> tag\", () => {\n\t\t\t\t\t\t\tconst { tree: text } = createFormattedTreeView(\"Hello\");\n\t\t\t\t\t\t\tconst content = <FormattedMainView root={toPropTreeNode(text)} />;\n\t\t\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\n\t\t\t\t\t\t\tassert.ok(!rendered.container.querySelector(\"em\"), \"Initially: no <em>\");\n\n\t\t\t\t\t\t\ttext.defaultFormat = new FormattedTextAsTree.CharacterFormat({\n\t\t\t\t\t\t\t\tbold: false,\n\t\t\t\t\t\t\t\titalic: true,\n\t\t\t\t\t\t\t\tunderline: false,\n\t\t\t\t\t\t\t\tsize: 12,\n\t\t\t\t\t\t\t\tfont: \"Arial\",\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\ttext.insertAt(2, \"ITAL\");\n\n\t\t\t\t\t\t\trendered.rerender(content);\n\t\t\t\t\t\t\tconst el = rendered.container.querySelector(\"em\");\n\t\t\t\t\t\t\tassert.ok(el, \"Expected <em> tag\");\n\t\t\t\t\t\t\tassert.match(el.textContent ?? \"\", /ITAL/);\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tit(\"deletes italic text and removes <em> tag\", () => {\n\t\t\t\t\t\t\tconst { tree: text } = createFormattedTreeView();\n\t\t\t\t\t\t\ttext.defaultFormat = new FormattedTextAsTree.CharacterFormat({\n\t\t\t\t\t\t\t\tbold: false,\n\t\t\t\t\t\t\t\titalic: true,\n\t\t\t\t\t\t\t\tunderline: false,\n\t\t\t\t\t\t\t\tsize: 12,\n\t\t\t\t\t\t\t\tfont: \"Arial\",\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\ttext.insertAt(0, \"ITAL\");\n\t\t\t\t\t\t\ttext.defaultFormat = createPlainFormat();\n\t\t\t\t\t\t\ttext.insertAt(4, \"plain\");\n\n\t\t\t\t\t\t\tconst content = <FormattedMainView root={toPropTreeNode(text)} />;\n\t\t\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\n\t\t\t\t\t\t\tassert.ok(rendered.container.querySelector(\"em\"), \"Initially: has <em>\");\n\n\t\t\t\t\t\t\ttext.removeRange(0, 4);\n\t\t\t\t\t\t\trendered.rerender(content);\n\n\t\t\t\t\t\t\tassert.ok(!rendered.container.querySelector(\"em\"), \"After delete: no <em>\");\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tit(\"applies italic via formatRange\", () => {\n\t\t\t\t\t\t\tconst { tree: text } = createFormattedTreeView(\"Hello World\");\n\t\t\t\t\t\t\tconst content = <FormattedMainView root={toPropTreeNode(text)} />;\n\t\t\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\n\t\t\t\t\t\t\ttext.formatRange(6, 11, { italic: true });\n\t\t\t\t\t\t\trendered.rerender(content);\n\n\t\t\t\t\t\t\tconst el = rendered.container.querySelector(\"em\");\n\t\t\t\t\t\t\tassert.ok(el, \"Expected <em> after formatRange\");\n\t\t\t\t\t\t\tassert.match(el.textContent ?? \"\", /World/);\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\n\t\t\t\t\tdescribe(\"underline\", () => {\n\t\t\t\t\t\tit(\"inserts underlined text and renders with <u> tag\", () => {\n\t\t\t\t\t\t\tconst { tree: text } = createFormattedTreeView(\"Hello\");\n\t\t\t\t\t\t\tconst content = <FormattedMainView root={toPropTreeNode(text)} />;\n\t\t\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\n\t\t\t\t\t\t\tassert.ok(!rendered.container.querySelector(\"u\"), \"Initially: no <u>\");\n\n\t\t\t\t\t\t\ttext.defaultFormat = new FormattedTextAsTree.CharacterFormat({\n\t\t\t\t\t\t\t\tbold: false,\n\t\t\t\t\t\t\t\titalic: false,\n\t\t\t\t\t\t\t\tunderline: true,\n\t\t\t\t\t\t\t\tsize: 12,\n\t\t\t\t\t\t\t\tfont: \"Arial\",\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\ttext.insertAt(2, \"UNDER\");\n\n\t\t\t\t\t\t\trendered.rerender(content);\n\t\t\t\t\t\t\tconst el = rendered.container.querySelector(\"u\");\n\t\t\t\t\t\t\tassert.ok(el, \"Expected <u> tag\");\n\t\t\t\t\t\t\tassert.match(el.textContent ?? \"\", /UNDER/);\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tit(\"deletes underlined text and removes <u> tag\", () => {\n\t\t\t\t\t\t\tconst { tree: text } = createFormattedTreeView();\n\t\t\t\t\t\t\ttext.defaultFormat = new FormattedTextAsTree.CharacterFormat({\n\t\t\t\t\t\t\t\tbold: false,\n\t\t\t\t\t\t\t\titalic: false,\n\t\t\t\t\t\t\t\tunderline: true,\n\t\t\t\t\t\t\t\tsize: 12,\n\t\t\t\t\t\t\t\tfont: \"Arial\",\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\ttext.insertAt(0, \"UNDER\");\n\t\t\t\t\t\t\ttext.defaultFormat = createPlainFormat();\n\t\t\t\t\t\t\ttext.insertAt(5, \"plain\");\n\n\t\t\t\t\t\t\tconst content = <FormattedMainView root={toPropTreeNode(text)} />;\n\t\t\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\n\t\t\t\t\t\t\tassert.ok(rendered.container.querySelector(\"u\"), \"Initially: has <u>\");\n\n\t\t\t\t\t\t\ttext.removeRange(0, 5);\n\t\t\t\t\t\t\trendered.rerender(content);\n\n\t\t\t\t\t\t\tassert.ok(!rendered.container.querySelector(\"u\"), \"After delete: no <u>\");\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tit(\"applies underline via formatRange\", () => {\n\t\t\t\t\t\t\tconst { tree: text } = createFormattedTreeView(\"Hello World\");\n\t\t\t\t\t\t\tconst content = <FormattedMainView root={toPropTreeNode(text)} />;\n\t\t\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\n\t\t\t\t\t\t\ttext.formatRange(6, 11, { underline: true });\n\t\t\t\t\t\t\trendered.rerender(content);\n\n\t\t\t\t\t\t\tconst el = rendered.container.querySelector(\"u\");\n\t\t\t\t\t\t\tassert.ok(el, \"Expected <u> after formatRange\");\n\t\t\t\t\t\t\tassert.match(el.textContent ?? \"\", /World/);\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\n\t\t\t\t\tdescribe(\"size\", () => {\n\t\t\t\t\t\tit(\"inserts huge size text and renders with .ql-size-huge\", () => {\n\t\t\t\t\t\t\tconst { tree: text } = createFormattedTreeView(\"Hello\");\n\t\t\t\t\t\t\tconst content = <FormattedMainView root={toPropTreeNode(text)} />;\n\t\t\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\n\t\t\t\t\t\t\tassert.ok(\n\t\t\t\t\t\t\t\t!rendered.container.querySelector(\".ql-size-huge\"),\n\t\t\t\t\t\t\t\t\"Initially: no .ql-size-huge\",\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\ttext.defaultFormat = new FormattedTextAsTree.CharacterFormat({\n\t\t\t\t\t\t\t\tbold: false,\n\t\t\t\t\t\t\t\titalic: false,\n\t\t\t\t\t\t\t\tunderline: false,\n\t\t\t\t\t\t\t\tsize: 24,\n\t\t\t\t\t\t\t\tfont: \"Arial\",\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\ttext.insertAt(2, \"HUGE\");\n\n\t\t\t\t\t\t\trendered.rerender(content);\n\t\t\t\t\t\t\tconst el = rendered.container.querySelector(\".ql-size-huge\");\n\t\t\t\t\t\t\tassert.ok(el, \"Expected .ql-size-huge\");\n\t\t\t\t\t\t\tassert.match(el.textContent ?? \"\", /HUGE/);\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tit(\"deletes huge size text and removes .ql-size-huge\", () => {\n\t\t\t\t\t\t\tconst { tree: text } = createFormattedTreeView();\n\t\t\t\t\t\t\ttext.defaultFormat = new FormattedTextAsTree.CharacterFormat({\n\t\t\t\t\t\t\t\tbold: false,\n\t\t\t\t\t\t\t\titalic: false,\n\t\t\t\t\t\t\t\tunderline: false,\n\t\t\t\t\t\t\t\tsize: 24,\n\t\t\t\t\t\t\t\tfont: \"Arial\",\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\ttext.insertAt(0, \"HUGE\");\n\t\t\t\t\t\t\ttext.defaultFormat = createPlainFormat();\n\t\t\t\t\t\t\ttext.insertAt(4, \"plain\");\n\n\t\t\t\t\t\t\tconst content = <FormattedMainView root={toPropTreeNode(text)} />;\n\t\t\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\n\t\t\t\t\t\t\tassert.ok(\n\t\t\t\t\t\t\t\trendered.container.querySelector(\".ql-size-huge\"),\n\t\t\t\t\t\t\t\t\"Initially: has .ql-size-huge\",\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\ttext.removeRange(0, 4);\n\t\t\t\t\t\t\trendered.rerender(content);\n\n\t\t\t\t\t\t\tassert.ok(\n\t\t\t\t\t\t\t\t!rendered.container.querySelector(\".ql-size-huge\"),\n\t\t\t\t\t\t\t\t\"After delete: no .ql-size-huge\",\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tit(\"applies size via formatRange\", () => {\n\t\t\t\t\t\t\tconst { tree: text } = createFormattedTreeView(\"Hello World\");\n\t\t\t\t\t\t\tconst content = <FormattedMainView root={toPropTreeNode(text)} />;\n\t\t\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\n\t\t\t\t\t\t\ttext.formatRange(6, 11, { size: 24 });\n\t\t\t\t\t\t\trendered.rerender(content);\n\n\t\t\t\t\t\t\tconst el = rendered.container.querySelector(\".ql-size-huge\");\n\t\t\t\t\t\t\tassert.ok(el, \"Expected .ql-size-huge after formatRange\");\n\t\t\t\t\t\t\tassert.match(el.textContent ?? \"\", /World/);\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\n\t\t\t\t\tdescribe(\"font\", () => {\n\t\t\t\t\t\tit(\"inserts monospace font text and renders with .ql-font-monospace\", () => {\n\t\t\t\t\t\t\tconst { tree: text } = createFormattedTreeView(\"Hello\");\n\t\t\t\t\t\t\tconst content = <FormattedMainView root={toPropTreeNode(text)} />;\n\t\t\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\n\t\t\t\t\t\t\tassert.ok(\n\t\t\t\t\t\t\t\t!rendered.container.querySelector(\".ql-font-monospace\"),\n\t\t\t\t\t\t\t\t\"Initially: no .ql-font-monospace\",\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\ttext.defaultFormat = new FormattedTextAsTree.CharacterFormat({\n\t\t\t\t\t\t\t\tbold: false,\n\t\t\t\t\t\t\t\titalic: false,\n\t\t\t\t\t\t\t\tunderline: false,\n\t\t\t\t\t\t\t\tsize: 12,\n\t\t\t\t\t\t\t\tfont: \"monospace\",\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\ttext.insertAt(2, \"MONO\");\n\n\t\t\t\t\t\t\trendered.rerender(content);\n\t\t\t\t\t\t\tconst el = rendered.container.querySelector(\".ql-font-monospace\");\n\t\t\t\t\t\t\tassert.ok(el, \"Expected .ql-font-monospace\");\n\t\t\t\t\t\t\tassert.match(el.textContent ?? \"\", /MONO/);\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tit(\"deletes monospace font text and removes .ql-font-monospace\", () => {\n\t\t\t\t\t\t\tconst { tree: text } = createFormattedTreeView();\n\t\t\t\t\t\t\ttext.defaultFormat = new FormattedTextAsTree.CharacterFormat({\n\t\t\t\t\t\t\t\tbold: false,\n\t\t\t\t\t\t\t\titalic: false,\n\t\t\t\t\t\t\t\tunderline: false,\n\t\t\t\t\t\t\t\tsize: 12,\n\t\t\t\t\t\t\t\tfont: \"monospace\",\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\ttext.insertAt(0, \"MONO\");\n\t\t\t\t\t\t\ttext.defaultFormat = createPlainFormat();\n\t\t\t\t\t\t\ttext.insertAt(4, \"plain\");\n\n\t\t\t\t\t\t\tconst content = <FormattedMainView root={toPropTreeNode(text)} />;\n\t\t\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\n\t\t\t\t\t\t\tassert.ok(\n\t\t\t\t\t\t\t\trendered.container.querySelector(\".ql-font-monospace\"),\n\t\t\t\t\t\t\t\t\"Initially: has .ql-font-monospace\",\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\ttext.removeRange(0, 4);\n\t\t\t\t\t\t\trendered.rerender(content);\n\n\t\t\t\t\t\t\tassert.ok(\n\t\t\t\t\t\t\t\t!rendered.container.querySelector(\".ql-font-monospace\"),\n\t\t\t\t\t\t\t\t\"After delete: no .ql-font-monospace\",\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tit(\"applies font via formatRange\", () => {\n\t\t\t\t\t\t\tconst { tree: text } = createFormattedTreeView(\"Hello World\");\n\t\t\t\t\t\t\tconst content = <FormattedMainView root={toPropTreeNode(text)} />;\n\t\t\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\n\t\t\t\t\t\t\ttext.formatRange(6, 11, { font: \"monospace\" });\n\t\t\t\t\t\t\trendered.rerender(content);\n\n\t\t\t\t\t\t\tconst el = rendered.container.querySelector(\".ql-font-monospace\");\n\t\t\t\t\t\t\tassert.ok(el, \"Expected .ql-font-monospace after formatRange\");\n\t\t\t\t\t\t\tassert.match(el.textContent ?? \"\", /World/);\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\t// Undo/Redo tests for non-transactional edits\n\t\tdescribe(\"undo/redo\", () => {\n\t\t\tfor (const reactStrictMode of [false, true]) {\n\t\t\t\tdescribe(`StrictMode: ${reactStrictMode}`, () => {\n\t\t\t\t\tit(\"insert character, undo removes it, redo restores it\", () => {\n\t\t\t\t\t\tconst treeView = createFormattedTreeViewWithEvents();\n\t\t\t\t\t\tconst text = treeView.root;\n\t\t\t\t\t\tconst undoRedo = new UndoRedoStacks(treeView.events);\n\t\t\t\t\t\tconst editorRef = React.createRef<FormattedEditorHandle>();\n\t\t\t\t\t\tconst content = (\n\t\t\t\t\t\t\t<FormattedMainView\n\t\t\t\t\t\t\t\tref={editorRef}\n\t\t\t\t\t\t\t\troot={toPropTreeNode(text)}\n\t\t\t\t\t\t\t\tundoRedo={undoRedo}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\n\t\t\t\t\t\t// Insert a character\n\t\t\t\t\t\ttext.insertAt(0, \"A\");\n\t\t\t\t\t\trendered.rerender(content);\n\t\t\t\t\t\tassert.match(rendered.baseElement.textContent ?? \"\", /A/);\n\n\t\t\t\t\t\t// Undo - character should be removed\n\t\t\t\t\t\teditorRef.current?.undo();\n\t\t\t\t\t\trendered.rerender(content);\n\t\t\t\t\t\tassert(rendered.baseElement.textContent !== null);\n\t\t\t\t\t\tassert.doesNotMatch(rendered.baseElement.textContent, /A/);\n\n\t\t\t\t\t\t// Redo - character should be restored\n\t\t\t\t\t\teditorRef.current?.redo();\n\t\t\t\t\t\trendered.rerender(content);\n\t\t\t\t\t\tassert.match(rendered.baseElement.textContent ?? \"\", /A/);\n\t\t\t\t\t});\n\n\t\t\t\t\tit(\"insert character, make bold, undo removes bold but keeps character\", () => {\n\t\t\t\t\t\tconst treeView = createFormattedTreeViewWithEvents();\n\t\t\t\t\t\tconst text = treeView.root;\n\t\t\t\t\t\tconst undoRedo = new UndoRedoStacks(treeView.events);\n\t\t\t\t\t\tconst editorRef = React.createRef<FormattedEditorHandle>();\n\t\t\t\t\t\tconst content = (\n\t\t\t\t\t\t\t<FormattedMainView\n\t\t\t\t\t\t\t\tref={editorRef}\n\t\t\t\t\t\t\t\troot={toPropTreeNode(text)}\n\t\t\t\t\t\t\t\tundoRedo={undoRedo}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\n\t\t\t\t\t\t// Insert a character\n\t\t\t\t\t\ttext.insertAt(0, \"B\");\n\t\t\t\t\t\trendered.rerender(content);\n\t\t\t\t\t\tassert.match(rendered.baseElement.textContent ?? \"\", /B/);\n\t\t\t\t\t\tassert.ok(!rendered.container.querySelector(\"strong\"), \"Initially: no <strong>\");\n\n\t\t\t\t\t\t// Make it bold\n\t\t\t\t\t\ttext.formatRange(0, 1, { bold: true });\n\t\t\t\t\t\trendered.rerender(content);\n\t\t\t\t\t\tassert.ok(\n\t\t\t\t\t\t\trendered.container.querySelector(\"strong\"),\n\t\t\t\t\t\t\t\"After format: has <strong>\",\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// Undo - bold should be removed, character should remain\n\t\t\t\t\t\teditorRef.current?.undo();\n\t\t\t\t\t\trendered.rerender(content);\n\t\t\t\t\t\tassert.match(rendered.baseElement.textContent ?? \"\", /B/);\n\t\t\t\t\t\tassert.ok(\n\t\t\t\t\t\t\t!rendered.container.querySelector(\"strong\"),\n\t\t\t\t\t\t\t\"After undo: no <strong>, character remains\",\n\t\t\t\t\t\t);\n\t\t\t\t\t});\n\n\t\t\t\t\tit(\"multiple operations in transaction undo together as one unit\", () => {\n\t\t\t\t\t\tconst treeView = createFormattedTreeViewWithEvents();\n\t\t\t\t\t\tconst text = treeView.root;\n\t\t\t\t\t\tconst undoRedo = new UndoRedoStacks(treeView.events);\n\t\t\t\t\t\tconst editorRef = React.createRef<FormattedEditorHandle>();\n\t\t\t\t\t\tconst content = (\n\t\t\t\t\t\t\t<FormattedMainView\n\t\t\t\t\t\t\t\tref={editorRef}\n\t\t\t\t\t\t\t\troot={toPropTreeNode(text)}\n\t\t\t\t\t\t\t\tundoRedo={undoRedo}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\n\t\t\t\t\t\t// Two operations in one transaction\n\t\t\t\t\t\tTreeAlpha.branch(text)?.runTransaction(() => {\n\t\t\t\t\t\t\ttext.insertAt(0, \"A\");\n\t\t\t\t\t\t\ttext.insertAt(1, \"B\");\n\t\t\t\t\t\t});\n\t\t\t\t\t\trendered.rerender(content);\n\t\t\t\t\t\tassert.match(rendered.baseElement.textContent ?? \"\", /AB/);\n\n\t\t\t\t\t\t// Single undo should remove both characters\n\t\t\t\t\t\teditorRef.current?.undo();\n\t\t\t\t\t\trendered.rerender(content);\n\t\t\t\t\t\tassert(rendered.baseElement.textContent !== null);\n\t\t\t\t\t\tassert.doesNotMatch(rendered.baseElement.textContent, /A/);\n\t\t\t\t\t\tassert.doesNotMatch(rendered.baseElement.textContent, /B/);\n\n\t\t\t\t\t\t// Single redo should restore both characters\n\t\t\t\t\t\teditorRef.current?.redo();\n\t\t\t\t\t\trendered.rerender(content);\n\t\t\t\t\t\tassert.match(rendered.baseElement.textContent ?? \"\", /AB/);\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t\tdescribe(\"copy-paste helpers\", () => {\n\t\t\t/** Helper to create an HTMLElement with inline styles. */\n\t\t\tfunction styledElement(styles: Partial<CSSStyleDeclaration>): HTMLElement {\n\t\t\t\tconst el = document.createElement(\"span\");\n\t\t\t\tObject.assign(el.style, styles);\n\t\t\t\treturn el;\n\t\t\t}\n\n\t\t\tdescribe(\"parseCssFontSize\", () => {\n\t\t\t\tit(\"returns undefined when no fontSize is set\", () => {\n\t\t\t\t\tassert.equal(parseCssFontSize(styledElement({})), undefined);\n\t\t\t\t});\n\n\t\t\t\tit(\"returns Quill size name for supported pixel values\", () => {\n\t\t\t\t\tassert.equal(parseCssFontSize(styledElement({ fontSize: \"10px\" })), \"small\");\n\t\t\t\t\tassert.equal(parseCssFontSize(styledElement({ fontSize: \"18px\" })), \"large\");\n\t\t\t\t\tassert.equal(parseCssFontSize(styledElement({ fontSize: \"24px\" })), \"huge\");\n\t\t\t\t});\n\n\t\t\t\tit(\"returns undefined for default or unrecognized sizes\", () => {\n\t\t\t\t\tassert.equal(parseCssFontSize(styledElement({ fontSize: \"12px\" })), undefined);\n\t\t\t\t\tassert.equal(parseCssFontSize(styledElement({ fontSize: \"42px\" })), undefined);\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tdescribe(\"parseCssFontFamily\", () => {\n\t\t\t\tit(\"returns undefined when no fontFamily is set\", () => {\n\t\t\t\t\tassert.equal(parseCssFontFamily(styledElement({})), undefined);\n\t\t\t\t});\n\n\t\t\t\tit(\"returns first recognized font in a comma-separated stack\", () => {\n\t\t\t\t\tassert.equal(\n\t\t\t\t\t\tparseCssFontFamily(styledElement({ fontFamily: \"monospace\" })),\n\t\t\t\t\t\t\"monospace\",\n\t\t\t\t\t);\n\t\t\t\t\tassert.equal(\n\t\t\t\t\t\tparseCssFontFamily(styledElement({ fontFamily: '\"Courier New\", monospace' })),\n\t\t\t\t\t\t\"monospace\",\n\t\t\t\t\t);\n\t\t\t\t\tassert.equal(\n\t\t\t\t\t\tparseCssFontFamily(\n\t\t\t\t\t\t\tstyledElement({ fontFamily: '\"Times New Roman\", \"Arial\", serif' }),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t\"Arial\",\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t\t\tit(\"strips single quotes around recognized font names\", () => {\n\t\t\t\t\tassert.equal(parseCssFontFamily(styledElement({ fontFamily: \"'Arial'\" })), \"Arial\");\n\t\t\t\t});\n\t\t\t\tit(\"returns undefined for unrecognized fonts\", () => {\n\t\t\t\t\tassert.equal(\n\t\t\t\t\t\tparseCssFontFamily(styledElement({ fontFamily: '\"Courier New\", fantasy' })),\n\t\t\t\t\t\tundefined,\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tdescribe(\"clipboardFormatMatcher\", () => {\n\t\t\t\tit(\"returns delta unchanged for non-HTMLElement nodes\", () => {\n\t\t\t\t\tconst delta = new Delta().insert(\"hello\");\n\t\t\t\t\tconst text = document.createTextNode(\"hello\");\n\t\t\t\t\tconst result = clipboardFormatMatcher(text, delta);\n\t\t\t\t\tassert.deepEqual(result.ops, delta.ops);\n\t\t\t\t});\n\n\t\t\t\tit(\"applies size and font attributes from inline styles\", () => {\n\t\t\t\t\tconst delta = new Delta().insert(\"hello\");\n\t\t\t\t\tconst el = styledElement({ fontSize: \"18px\", fontFamily: \"serif\" });\n\t\t\t\t\tconst result = clipboardFormatMatcher(el, delta);\n\t\t\t\t\tassert.equal(result.ops[0]?.attributes?.size, \"large\");\n\t\t\t\t\tassert.equal(result.ops[0]?.attributes?.font, \"serif\");\n\t\t\t\t});\n\n\t\t\t\tit(\"returns delta unchanged when no recognized styles\", () => {\n\t\t\t\t\tconst delta = new Delta().insert(\"hello\");\n\t\t\t\t\tconst el = styledElement({});\n\t\t\t\t\tconst result = clipboardFormatMatcher(el, delta);\n\t\t\t\t\tassert.deepEqual(result.ops, delta.ops);\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\n\t\t// Unicode 16+ (joined emojis) section - test attribute cycling\n\t\tdescribe(\"Unicode 16+ joined emoji attribute cycling\", () => {\n\t\t\t// ZWJ (Zero Width Joiner) emoji sequence: 👨👩👧👦 = family emoji\n\t\t\tconst joinedEmoji = \"👨👩👧👦\";\n\n\t\t\tfor (const reactStrictMode of [false, true]) {\n\t\t\t\tdescribe(`StrictMode: ${reactStrictMode}`, () => {\n\t\t\t\t\tit(\"applies bold to joined emoji and removes it preserving text\", () => {\n\t\t\t\t\t\tconst { tree: text } = createFormattedTreeView(`Test ${joinedEmoji} Text`);\n\t\t\t\t\t\tconst content = <FormattedMainView root={toPropTreeNode(text)} />;\n\t\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\n\t\t\t\t\t\tconst emojiStart = 5; // \"Test \" is 5 chars\n\t\t\t\t\t\tconst emojiLength = [...joinedEmoji].length;\n\t\t\t\t\t\ttext.formatRange(emojiStart, emojiStart + emojiLength, { bold: true });\n\t\t\t\t\t\trendered.rerender(content);\n\n\t\t\t\t\t\tassert.ok(\n\t\t\t\t\t\t\trendered.container.querySelector(\"strong\"),\n\t\t\t\t\t\t\t\"After bold: expected <strong>\",\n\t\t\t\t\t\t);\n\t\t\t\t\t\tassert.ok(\n\t\t\t\t\t\t\t(rendered.baseElement.textContent ?? \"\").includes(joinedEmoji),\n\t\t\t\t\t\t\t\"After bold: emoji should be preserved\",\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\ttext.formatRange(emojiStart, emojiStart + emojiLength, { bold: false });\n\t\t\t\t\t\trendered.rerender(content);\n\n\t\t\t\t\t\tassert.ok(\n\t\t\t\t\t\t\t!rendered.container.querySelector(\"strong\"),\n\t\t\t\t\t\t\t\"After remove bold: no <strong> expected\",\n\t\t\t\t\t\t);\n\t\t\t\t\t\tassert.ok(\n\t\t\t\t\t\t\t(rendered.baseElement.textContent ?? \"\").includes(joinedEmoji),\n\t\t\t\t\t\t\t\"After remove bold: emoji should still be preserved\",\n\t\t\t\t\t\t);\n\t\t\t\t\t});\n\n\t\t\t\t\tit(\"applies size to joined emoji and removes it preserving text\", () => {\n\t\t\t\t\t\tconst { tree: text } = createFormattedTreeView(`Test ${joinedEmoji} Text`);\n\t\t\t\t\t\tconst content = <FormattedMainView root={toPropTreeNode(text)} />;\n\t\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\n\t\t\t\t\t\tconst emojiStart = 5;\n\t\t\t\t\t\tconst emojiLength = [...joinedEmoji].length;\n\t\t\t\t\t\ttext.formatRange(emojiStart, emojiStart + emojiLength, { size: 24 });\n\t\t\t\t\t\trendered.rerender(content);\n\n\t\t\t\t\t\tassert.ok(\n\t\t\t\t\t\t\trendered.container.querySelector(\".ql-size-huge\"),\n\t\t\t\t\t\t\t\"After size: expected .ql-size-huge\",\n\t\t\t\t\t\t);\n\t\t\t\t\t\tassert.ok(\n\t\t\t\t\t\t\t(rendered.baseElement.textContent ?? \"\").includes(joinedEmoji),\n\t\t\t\t\t\t\t\"Emoji preserved\",\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\ttext.formatRange(emojiStart, emojiStart + emojiLength, { size: 12 });\n\t\t\t\t\t\trendered.rerender(content);\n\n\t\t\t\t\t\tassert.ok(\n\t\t\t\t\t\t\t!rendered.container.querySelector(\".ql-size-huge\"),\n\t\t\t\t\t\t\t\"After remove: no .ql-size-huge\",\n\t\t\t\t\t\t);\n\t\t\t\t\t\tassert.ok(\n\t\t\t\t\t\t\t(rendered.baseElement.textContent ?? \"\").includes(joinedEmoji),\n\t\t\t\t\t\t\t\"Emoji still preserved\",\n\t\t\t\t\t\t);\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t});\n});\n"]}
|
|
1
|
+
{"version":3,"file":"textEditor.test.js","sourceRoot":"","sources":["../../../src/test/text/textEditor.test.tsx"],"names":[],"mappings":";AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,WAAW,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACpC,IAAI,OAAmB,CAAC;IACxB,MAAM,CAAC,GAAG,EAAE;QACX,OAAO,GAAG,WAAW,EAAE,CAAC;IACzB,CAAC,CAAC,CAAC;IACH,KAAK,CAAC,GAAG,EAAE;QACV,OAAO,EAAE,CAAC;IACX,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;QAC1B,8EAA8E;QAC9E,gEAAgE;QAChE,KAAK,MAAM,eAAe,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC;YAC7C,QAAQ,CAAC,eAAe,eAAe,EAAE,EAAE,GAAG,EAAE;gBAC/C,MAAM,aAAa,GAAG,iBAAiB,CAAC;gBAEx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AC;oBAClD,MAAM,OAAO,GAAG,KAAC,aAAa,IAAC,IAAI,EAAE,cAAc,CAAC,IAAI,CAAC,GAAI,CAAC;oBAC9D,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,EAAE,EAAE,eAAe,EAAE,CAAC,CAAC;oBAEtD,wBAAwB;oBACxB,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;oBAEtB,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;oBAC3B,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,WAAW,IAAI,EAAE,EAAE,SAAS,CAAC,CAAC;gBACjE,CAAC,CAAC,CAAC;YACJ,CAAC,CAAC,CAAC;QACJ,CAAC;IACF,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { strict as assert } from \"node:assert\";\n\nimport { TextAsTree } from \"@fluidframework/tree/internal\";\nimport { render } from \"@testing-library/react\";\nimport globalJsdom from \"global-jsdom\";\n\nimport { toPropTreeNode } from \"../../propNode.js\";\nimport { PlainTextMainView } from \"../../text/index.js\";\n\ndescribe(\"Plain TextArea view\", () => {\n\tlet cleanup: () => void;\n\tbefore(() => {\n\t\tcleanup = globalJsdom();\n\t});\n\tafter(() => {\n\t\tcleanup();\n\t});\n\n\tdescribe(\"dom tests\", () => {\n\t\t// Run without strict mode to make sure it works in a normal production setup.\n\t\t// Run with strict mode to potentially detect additional issues.\n\t\tfor (const reactStrictMode of [false, true]) {\n\t\t\tdescribe(`StrictMode: ${reactStrictMode}`, () => {\n\t\t\t\tconst ViewComponent = PlainTextMainView;\n\n\t\t\t\tit(\"renders MainView with editor container\", () => {\n\t\t\t\t\tconst text = TextAsTree.Tree.fromString(\"\");\n\t\t\t\t\tconst content = <ViewComponent root={toPropTreeNode(text)} />;\n\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\n\t\t\t\t\tassert.match(rendered.baseElement.textContent ?? \"\", /Collaborative Text Editor/);\n\t\t\t\t});\n\n\t\t\t\tit(\"renders MainView with initial text content\", () => {\n\t\t\t\t\tconst text = TextAsTree.Tree.fromString(\"Hello World\");\n\t\t\t\t\tconst content = <ViewComponent root={toPropTreeNode(text)} />;\n\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\n\t\t\t\t\tassert.match(rendered.baseElement.textContent ?? \"\", /Hello World/);\n\t\t\t\t});\n\n\t\t\t\tit(\"invalidates view when tree is mutated\", () => {\n\t\t\t\t\tconst text = TextAsTree.Tree.fromString(\"Hello\");\n\t\t\t\t\tconst content = <ViewComponent root={toPropTreeNode(text)} />;\n\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\n\t\t\t\t\t// Mutate the tree by inserting text\n\t\t\t\t\ttext.insertAt(5, \" World\");\n\n\t\t\t\t\t// Rerender and verify the view updates\n\t\t\t\t\trendered.rerender(content);\n\t\t\t\t\tassert.match(rendered.baseElement.textContent ?? \"\", /Hello World/);\n\t\t\t\t});\n\n\t\t\t\tit(\"invalidates view when text is removed\", () => {\n\t\t\t\t\tconst text = TextAsTree.Tree.fromString(\"Hello World\");\n\t\t\t\t\tconst content = <ViewComponent root={toPropTreeNode(text)} />;\n\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\n\t\t\t\t\t// Mutate the tree by removing \" World\" (indices 5 to 11)\n\t\t\t\t\ttext.removeRange(5, 11);\n\n\t\t\t\t\t// Rerender and verify the view updates\n\t\t\t\t\trendered.rerender(content);\n\t\t\t\t\tassert.match(rendered.baseElement.textContent ?? \"\", /Hello/);\n\t\t\t\t\tassert(rendered.baseElement.textContent !== null);\n\t\t\t\t\tassert.doesNotMatch(rendered.baseElement.textContent, /World/);\n\t\t\t\t});\n\n\t\t\t\tit(\"invalidates view when text is cleared and replaced\", () => {\n\t\t\t\t\tconst text = TextAsTree.Tree.fromString(\"Original\");\n\t\t\t\t\tconst content = <ViewComponent root={toPropTreeNode(text)} />;\n\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\n\t\t\t\t\t// Clear all text\n\t\t\t\t\tconst length = [...text.characters()].length;\n\t\t\t\t\ttext.removeRange(0, length);\n\n\t\t\t\t\t// Insert new text\n\t\t\t\t\ttext.insertAt(0, \"Replaced\");\n\n\t\t\t\t\t// Rerender and verify the view updates\n\t\t\t\t\trendered.rerender(content);\n\t\t\t\t\tassert.match(rendered.baseElement.textContent ?? \"\", /Replaced/);\n\t\t\t\t\tassert(rendered.baseElement.textContent !== null);\n\t\t\t\t\tassert.doesNotMatch(rendered.baseElement.textContent, /Original/);\n\t\t\t\t});\n\n\t\t\t\t// Tests for surrogate pair characters (emojis use 2 UTF-16 code units)\n\t\t\t\t// These verify correct handling where editor indexing may differ from iteration.\n\n\t\t\t\tit(\"renders MainView with surrogate pair characters\", () => {\n\t\t\t\t\t// 😀 is a surrogate pair: \"😀\".length === 2, but [...\"😀\"].length === 1\n\t\t\t\t\tconst text = TextAsTree.Tree.fromString(\"Hello 😀 World\");\n\t\t\t\t\tconst content = <ViewComponent root={toPropTreeNode(text)} />;\n\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\n\t\t\t\t\tassert.match(rendered.baseElement.textContent ?? \"\", /Hello 😀 World/);\n\t\t\t\t});\n\n\t\t\t\tit(\"inserts text after surrogate pair characters\", () => {\n\t\t\t\t\tconst text = TextAsTree.Tree.fromString(\"A😀B\");\n\t\t\t\t\tconst content = <ViewComponent root={toPropTreeNode(text)} />;\n\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\n\t\t\t\t\t// Insert after the emoji (index 2 in character count: A, 😀, B)\n\t\t\t\t\ttext.insertAt(2, \"X\");\n\n\t\t\t\t\trendered.rerender(content);\n\t\t\t\t\tassert.match(rendered.baseElement.textContent ?? \"\", /A😀XB/);\n\t\t\t\t});\n\n\t\t\t\tit(\"removes surrogate pair characters\", () => {\n\t\t\t\t\tconst text = TextAsTree.Tree.fromString(\"A😀B\");\n\t\t\t\t\tconst content = <ViewComponent root={toPropTreeNode(text)} />;\n\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\n\t\t\t\t\t// Remove the emoji (index 1, length 1 in character count)\n\t\t\t\t\ttext.removeRange(1, 2);\n\n\t\t\t\t\trendered.rerender(content);\n\t\t\t\t\tassert.match(rendered.baseElement.textContent ?? \"\", /AB/);\n\t\t\t\t\tassert(rendered.baseElement.textContent !== null);\n\t\t\t\t\tassert.doesNotMatch(rendered.baseElement.textContent, /😀/);\n\t\t\t\t});\n\n\t\t\t\tit(\"handles multiple surrogate pair characters\", () => {\n\t\t\t\t\tconst text = TextAsTree.Tree.fromString(\"👋🌍🎉\");\n\t\t\t\t\tconst content = <ViewComponent root={toPropTreeNode(text)} />;\n\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\n\t\t\t\t\t// Insert between emojis\n\t\t\t\t\ttext.insertAt(2, \"!\");\n\n\t\t\t\t\trendered.rerender(content);\n\t\t\t\t\tassert.match(rendered.baseElement.textContent ?? \"\", /👋🌍!🎉/);\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t});\n});\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
/*!
|
|
2
3
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
4
|
* Licensed under the MIT License.
|
|
@@ -5,7 +6,6 @@
|
|
|
5
6
|
import { strict as assert } from "node:assert";
|
|
6
7
|
import { render } from "@testing-library/react";
|
|
7
8
|
import globalJsdom from "global-jsdom";
|
|
8
|
-
import * as React from "react";
|
|
9
9
|
import { useObservation, useObservationStrict, useObservationWithEffects, } from "../useObservation.js";
|
|
10
10
|
// There is much more coverage of useObservation via useTree tests.
|
|
11
11
|
describe("useObservation", () => {
|
|
@@ -51,16 +51,16 @@ describe("useObservation", () => {
|
|
|
51
51
|
return useObservationHook((invalidate) => {
|
|
52
52
|
log.push(`useObservation`);
|
|
53
53
|
return {
|
|
54
|
-
result: (
|
|
54
|
+
result: (_jsx("button", { onClick: () => {
|
|
55
55
|
// In real usage, this would unsubscribe from any events.
|
|
56
56
|
log.push("click");
|
|
57
57
|
invalidate();
|
|
58
|
-
}
|
|
58
|
+
}, children: "Invalidate" })),
|
|
59
59
|
unsubscribe,
|
|
60
60
|
};
|
|
61
61
|
}, { onInvalidation: () => log.push("invalidated") });
|
|
62
62
|
}
|
|
63
|
-
const content =
|
|
63
|
+
const content = _jsx(TestComponent, {});
|
|
64
64
|
const rendered = render(content, { reactStrictMode });
|
|
65
65
|
checkRenderLog(log, ["render", "useObservation"]);
|
|
66
66
|
rendered.rerender(content);
|
|
@@ -88,11 +88,11 @@ describe("useObservation", () => {
|
|
|
88
88
|
};
|
|
89
89
|
function TestComponent() {
|
|
90
90
|
return useObservationHook((invalidate) => ({
|
|
91
|
-
result:
|
|
91
|
+
result: _jsx("br", {}),
|
|
92
92
|
unsubscribe,
|
|
93
93
|
}));
|
|
94
94
|
}
|
|
95
|
-
const rendered = render(
|
|
95
|
+
const rendered = render(_jsx(TestComponent, {}), { reactStrictMode });
|
|
96
96
|
assertLogEmpty(log);
|
|
97
97
|
rendered.unmount();
|
|
98
98
|
// Unsubscribe on unmount is done via FinalizationRegistry, so force a GC and wait for it.
|
|
@@ -121,12 +121,12 @@ describe("useObservation", () => {
|
|
|
121
121
|
return useObservationHook((invalidate) => {
|
|
122
122
|
invalidateCallbacks.push(invalidate);
|
|
123
123
|
return {
|
|
124
|
-
result:
|
|
124
|
+
result: _jsx("br", {}),
|
|
125
125
|
unsubscribe,
|
|
126
126
|
};
|
|
127
127
|
}, { onInvalidation: () => log.push("invalidated") });
|
|
128
128
|
}
|
|
129
|
-
const rendered = render(
|
|
129
|
+
const rendered = render(_jsx(TestComponent, {}), { reactStrictMode });
|
|
130
130
|
checkRenderLog(log, ["render"]);
|
|
131
131
|
// After unmount, unsubscribe could happen at any time due to finalizer,so suppress logging it to prevent the test from possibly becoming flaky.
|
|
132
132
|
logUnsubscribe = false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useObservation.spec.js","sourceRoot":"","sources":["../../src/test/useObservation.spec.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,WAAW,MAAM,cAAc,CAAC;AACvC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACN,cAAc,EACd,oBAAoB,EACpB,yBAAyB,GACzB,MAAM,sBAAsB,CAAC;AAE9B,mEAAmE;AAEnE,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC/B,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;QAC1B,IAAI,OAAmB,CAAC;QAExB,MAAM,CAAC,GAAG,EAAE;YACX,OAAO,GAAG,WAAW,EAAE,CAAC;QACzB,CAAC,CAAC,CAAC;QAEH,KAAK,CAAC,GAAG,EAAE;YACV,OAAO,EAAE,CAAC;QACX,CAAC,CAAC,CAAC;QAEH,MAAM,gBAAgB,GAA8B;YACnD,cAAc;YACd,oBAAoB;YACpB,yBAAyB;SAChB,CAAC;QAEX,KAAK,MAAM,kBAAkB,IAAI,gBAAgB,EAAE,CAAC;YACnD,sEAAsE;YACtE,QAAQ,CAAE,kBAA+B,CAAC,IAAI,EAAE,GAAG,EAAE;gBACpD,KAAK,MAAM,eAAe,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC;oBAC7C;;;;uBAIG;oBACH,SAAS,cAAc,CAAC,GAAa,EAAE,QAA2B;wBACjE,IAAI,eAAe,EAAE,CAAC;4BACrB,MAAM,CAAC,SAAS,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,EAAE,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC;wBACnD,CAA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CAAC,MAAM,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;4BAEjE,4BAA4B;4BAC5B,4HAA4H;4BAC5H,sGAAsG;4BACtG,KAAK,MAAM,QAAQ,IAAI,mBAAmB,EAAE,CAAC;gCAC5C,QAAQ,EAAE,CAAC;4BACZ,CAAC;4BAED,sCAAsC;4BACtC,uHAAuH;4BACvH,cAAc,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;wBACtC,CAAC,CAAC,CAAC;oBACJ,CAAC,CAAC,CAAC;gBACJ,CAAC;YACF,CAAC,CAAC,CAAC;QACJ,CAAC;IACF,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH;;;;;;GAMG;AACH,SAAS,cAAc,CAAC,GAAa;IACpC,MAAM,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;AAC3B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { strict as assert } from \"node:assert\";\n\nimport { render } from \"@testing-library/react\";\nimport globalJsdom from \"global-jsdom\";\nimport * as React from \"react\";\n\nimport {\n\tuseObservation,\n\tuseObservationStrict,\n\tuseObservationWithEffects,\n} from \"../useObservation.js\";\n\n// There is much more coverage of useObservation via useTree tests.\n\ndescribe(\"useObservation\", () => {\n\tdescribe(\"dom tests\", () => {\n\t\tlet cleanup: () => void;\n\n\t\tbefore(() => {\n\t\t\tcleanup = globalJsdom();\n\t\t});\n\n\t\tafter(() => {\n\t\t\tcleanup();\n\t\t});\n\n\t\tconst observationHooks: (typeof useObservation)[] = [\n\t\t\tuseObservation,\n\t\t\tuseObservationStrict,\n\t\t\tuseObservationWithEffects,\n\t\t] as const;\n\n\t\tfor (const useObservationHook of observationHooks) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n\t\t\tdescribe((useObservationHook as Function).name, () => {\n\t\t\t\tfor (const reactStrictMode of [false, true]) {\n\t\t\t\t\t/**\n\t\t\t\t\t * Check then clear the contents of `log`.\n\t\t\t\t\t *\n\t\t\t\t\t * @remarks When in StrictMode, React may double render, so that case is not checked for an exact match.\n\t\t\t\t\t */\n\t\t\t\t\tfunction checkRenderLog(log: string[], expected: readonly string[]): void {\n\t\t\t\t\t\tif (reactStrictMode) {\n\t\t\t\t\t\t\tassert.deepEqual(new Set(log), new Set(expected));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tassert.deepEqual(log, expected);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlog.length = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tdescribe(`StrictMode: ${reactStrictMode}`, () => {\n\t\t\t\t\t\tit(\"useObservation\", async () => {\n\t\t\t\t\t\t\tconst log: string[] = [];\n\n\t\t\t\t\t\t\tconst unsubscribe = (): void => {\n\t\t\t\t\t\t\t\tlog.push(\"unsubscribe\");\n\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\tfunction TestComponent(): JSX.Element {\n\t\t\t\t\t\t\t\tlog.push(\"render\");\n\t\t\t\t\t\t\t\treturn useObservationHook(\n\t\t\t\t\t\t\t\t\t(invalidate) => {\n\t\t\t\t\t\t\t\t\t\tlog.push(`useObservation`);\n\t\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\t\tresult: (\n\t\t\t\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// In real usage, this would unsubscribe from any events.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlog.push(\"click\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tinvalidate();\n\t\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\tInvalidate\n\t\t\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\tunsubscribe,\n\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{ onInvalidation: () => log.push(\"invalidated\") },\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst content = <TestComponent />;\n\n\t\t\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\t\t\t\t\t\t\tcheckRenderLog(log, [\"render\", \"useObservation\"]);\n\n\t\t\t\t\t\t\trendered.rerender(content);\n\t\t\t\t\t\t\tassertLogEmpty(log);\n\n\t\t\t\t\t\t\tconst button =\n\t\t\t\t\t\t\t\trendered.baseElement.querySelector(\"button\") ??\n\t\t\t\t\t\t\t\tassert.fail(\"button not found\");\n\t\t\t\t\t\t\tbutton.click();\n\n\t\t\t\t\t\t\tcheckRenderLog(log, [\"click\", \"invalidated\"]);\n\n\t\t\t\t\t\t\trendered.rerender(content);\n\n\t\t\t\t\t\t\tcheckRenderLog(log, [\n\t\t\t\t\t\t\t\t\"render\",\n\t\t\t\t\t\t\t\t...(reactStrictMode && useObservationHook !== useObservationWithEffects\n\t\t\t\t\t\t\t\t\t? [\"unsubscribe\"]\n\t\t\t\t\t\t\t\t\t: []),\n\t\t\t\t\t\t\t\t\"useObservation\",\n\t\t\t\t\t\t\t]);\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\t// This requires waiting for finalizers.\n\t\t\t\t\t\t// Forcing two async GCs seems to work robustly, so this is enabled, but if it becomes flakey, it can be tweaked and/or skipped.\n\t\t\t\t\t\tit(`unsubscribe on unmount`, async () => {\n\t\t\t\t\t\t\tassert(global.gc);\n\n\t\t\t\t\t\t\tconst log: string[] = [];\n\n\t\t\t\t\t\t\tconst unsubscribe = (): void => {\n\t\t\t\t\t\t\t\tlog.push(\"unsubscribe\");\n\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\tfunction TestComponent(this: unknown): JSX.Element {\n\t\t\t\t\t\t\t\treturn useObservationHook((invalidate) => ({\n\t\t\t\t\t\t\t\t\tresult: <br />,\n\t\t\t\t\t\t\t\t\tunsubscribe,\n\t\t\t\t\t\t\t\t}));\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst rendered = render(<TestComponent />, { reactStrictMode });\n\n\t\t\t\t\t\t\tassertLogEmpty(log);\n\t\t\t\t\t\t\trendered.unmount();\n\n\t\t\t\t\t\t\t// Unsubscribe on unmount is done via FinalizationRegistry, so force a GC and wait for it.\n\t\t\t\t\t\t\t// For this to pass on NodeJs experimentally is has been found that this must either do:\n\t\t\t\t\t\t\t// 1. a sync GC then a wait of 8 seconds (but this sometimes fails after multiple runs unless a debugger takes a heap snapshot, possible due to some JIT optimization that breaks it).\n\t\t\t\t\t\t\t// 2. two async GCs in a row.\n\t\t\t\t\t\t\t// Since the second option is both more robust and faster, that is what is used here.\n\t\t\t\t\t\t\tfor (let index = 0; index < 2; index++) {\n\t\t\t\t\t\t\t\tawait global.gc({ type: \"major\", execution: \"async\" });\n\t\t\t\t\t\t\t\tif (log.length > 0) {\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tcheckRenderLog(log, [\"unsubscribe\"]);\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tit(\"invalidate after unmount\", () => {\n\t\t\t\t\t\t\tconst log: string[] = [];\n\n\t\t\t\t\t\t\tlet logUnsubscribe = true;\n\n\t\t\t\t\t\t\tconst unsubscribe = (): void => {\n\t\t\t\t\t\t\t\tif (logUnsubscribe) log.push(\"unsubscribe\");\n\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\tconst invalidateCallbacks: (() => void)[] = [];\n\n\t\t\t\t\t\t\tfunction TestComponent(): JSX.Element {\n\t\t\t\t\t\t\t\tlog.push(\"render\");\n\t\t\t\t\t\t\t\treturn useObservationHook(\n\t\t\t\t\t\t\t\t\t(invalidate) => {\n\t\t\t\t\t\t\t\t\t\tinvalidateCallbacks.push(invalidate);\n\t\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\t\tresult: <br />,\n\t\t\t\t\t\t\t\t\t\t\tunsubscribe,\n\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{ onInvalidation: () => log.push(\"invalidated\") },\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst rendered = render(<TestComponent />, { reactStrictMode });\n\n\t\t\t\t\t\t\tcheckRenderLog(log, [\"render\"]);\n\n\t\t\t\t\t\t\t// After unmount, unsubscribe could happen at any time due to finalizer,so suppress logging it to prevent the test from possibly becoming flaky.\n\t\t\t\t\t\t\tlogUnsubscribe = false;\n\n\t\t\t\t\t\t\trendered.unmount();\n\n\t\t\t\t\t\t\tassert(invalidateCallbacks.length === (reactStrictMode ? 2 : 1));\n\n\t\t\t\t\t\t\t// Invalidate after unmount.\n\t\t\t\t\t\t\t// Since this can happen in real use, due to unsubscribe delay while waiting for finalizer, ensure it does not cause issues.\n\t\t\t\t\t\t\t// This should be a no-op, but since it does a React SetState after unmount, React could object to it.\n\t\t\t\t\t\t\tfor (const callback of invalidateCallbacks) {\n\t\t\t\t\t\t\t\tcallback();\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Confirm the invalidation happened..\n\t\t\t\t\t\t\t// If we didn't suppress unsubscribe logging, and the finalizer had run, this could fail (which is why we suppress it).\n\t\t\t\t\t\t\tcheckRenderLog(log, [\"invalidated\"]);\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t});\n});\n\n/**\n * Assert that an array is empty.\n *\n * @remarks\n * Not inlined because doing so causes TypeScript to infer the array type as never[] afterwards and breaks push.\n * Better than asserting length is 0 as this gets a better error message on failure.\n */\nfunction assertLogEmpty(log: string[]): void {\n\tassert.deepEqual(log, []);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"useObservation.spec.js","sourceRoot":"","sources":["../../src/test/useObservation.spec.tsx"],"names":[],"mappings":";AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,WAAW,MAAM,cAAc,CAAC;AAEvC,OAAO,EACN,cAAc,EACd,oBAAoB,EACpB,yBAAyB,GACzB,MAAM,sBAAsB,CAAC;AAE9B,mEAAmE;AAEnE,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC/B,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;QAC1B,IAAI,OAAmB,CAAC;QAExB,MAAM,CAAC,GAAG,EAAE;YACX,OAAO,GAAG,WAAW,EAAE,CAAC;QACzB,CAAC,CAAC,CAAC;QAEH,KAAK,CAAC,GAAG,EAAE;YACV,OAAO,EAAE,CAAC;QACX,CAAC,CAAC,CAAC;QAEH,MAAM,gBAAgB,GAA8B;YACnD,cAAc;YACd,oBAAoB;YACpB,yBAAyB;SAChB,CAAC;QAEX,KAAK,MAAM,kBAAkB,IAAI,gBAAgB,EAAE,CAAC;YACnD,sEAAsE;YACtE,QAAQ,CAAE,kBAA+B,CAAC,IAAI,EAAE,GAAG,EAAE;gBACpD,KAAK,MAAM,eAAe,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC;oBAC7C;;;;uBAIG;oBACH,SAAS,cAAc,CAAC,GAAa,EAAE,QAA2B;wBACjE,IAAI,eAAe,EAAE,CAAC;4BACrB,MAAM,CAAC,SAAS,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,EAAE,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC;wBACnD,CAAC;6BAAM,CAAC;4BACP,MAAM,CAAC,SAAS,CAAC,GAAG,EAA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AAC,CAAC,CAAC,CAAC,CAAC,CAAC;4BAEjE,4BAA4B;4BAC5B,4HAA4H;4BAC5H,sGAAsG;4BACtG,KAAK,MAAM,QAAQ,IAAI,mBAAmB,EAAE,CAAC;gCAC5C,QAAQ,EAAE,CAAC;4BACZ,CAAC;4BAED,sCAAsC;4BACtC,uHAAuH;4BACvH,cAAc,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;wBACtC,CAAC,CAAC,CAAC;oBACJ,CAAC,CAAC,CAAC;gBACJ,CAAC;YACF,CAAC,CAAC,CAAC;QACJ,CAAC;IACF,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH;;;;;;GAMG;AACH,SAAS,cAAc,CAAC,GAAa;IACpC,MAAM,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;AAC3B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { strict as assert } from \"node:assert\";\n\nimport { render } from \"@testing-library/react\";\nimport globalJsdom from \"global-jsdom\";\n\nimport {\n\tuseObservation,\n\tuseObservationStrict,\n\tuseObservationWithEffects,\n} from \"../useObservation.js\";\n\n// There is much more coverage of useObservation via useTree tests.\n\ndescribe(\"useObservation\", () => {\n\tdescribe(\"dom tests\", () => {\n\t\tlet cleanup: () => void;\n\n\t\tbefore(() => {\n\t\t\tcleanup = globalJsdom();\n\t\t});\n\n\t\tafter(() => {\n\t\t\tcleanup();\n\t\t});\n\n\t\tconst observationHooks: (typeof useObservation)[] = [\n\t\t\tuseObservation,\n\t\t\tuseObservationStrict,\n\t\t\tuseObservationWithEffects,\n\t\t] as const;\n\n\t\tfor (const useObservationHook of observationHooks) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n\t\t\tdescribe((useObservationHook as Function).name, () => {\n\t\t\t\tfor (const reactStrictMode of [false, true]) {\n\t\t\t\t\t/**\n\t\t\t\t\t * Check then clear the contents of `log`.\n\t\t\t\t\t *\n\t\t\t\t\t * @remarks When in StrictMode, React may double render, so that case is not checked for an exact match.\n\t\t\t\t\t */\n\t\t\t\t\tfunction checkRenderLog(log: string[], expected: readonly string[]): void {\n\t\t\t\t\t\tif (reactStrictMode) {\n\t\t\t\t\t\t\tassert.deepEqual(new Set(log), new Set(expected));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tassert.deepEqual(log, expected);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlog.length = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tdescribe(`StrictMode: ${reactStrictMode}`, () => {\n\t\t\t\t\t\tit(\"useObservation\", async () => {\n\t\t\t\t\t\t\tconst log: string[] = [];\n\n\t\t\t\t\t\t\tconst unsubscribe = (): void => {\n\t\t\t\t\t\t\t\tlog.push(\"unsubscribe\");\n\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\tfunction TestComponent(): JSX.Element {\n\t\t\t\t\t\t\t\tlog.push(\"render\");\n\t\t\t\t\t\t\t\treturn useObservationHook(\n\t\t\t\t\t\t\t\t\t(invalidate) => {\n\t\t\t\t\t\t\t\t\t\tlog.push(`useObservation`);\n\t\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\t\tresult: (\n\t\t\t\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// In real usage, this would unsubscribe from any events.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlog.push(\"click\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tinvalidate();\n\t\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\tInvalidate\n\t\t\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\tunsubscribe,\n\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{ onInvalidation: () => log.push(\"invalidated\") },\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst content = <TestComponent />;\n\n\t\t\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\t\t\t\t\t\t\tcheckRenderLog(log, [\"render\", \"useObservation\"]);\n\n\t\t\t\t\t\t\trendered.rerender(content);\n\t\t\t\t\t\t\tassertLogEmpty(log);\n\n\t\t\t\t\t\t\tconst button =\n\t\t\t\t\t\t\t\trendered.baseElement.querySelector(\"button\") ??\n\t\t\t\t\t\t\t\tassert.fail(\"button not found\");\n\t\t\t\t\t\t\tbutton.click();\n\n\t\t\t\t\t\t\tcheckRenderLog(log, [\"click\", \"invalidated\"]);\n\n\t\t\t\t\t\t\trendered.rerender(content);\n\n\t\t\t\t\t\t\tcheckRenderLog(log, [\n\t\t\t\t\t\t\t\t\"render\",\n\t\t\t\t\t\t\t\t...(reactStrictMode && useObservationHook !== useObservationWithEffects\n\t\t\t\t\t\t\t\t\t? [\"unsubscribe\"]\n\t\t\t\t\t\t\t\t\t: []),\n\t\t\t\t\t\t\t\t\"useObservation\",\n\t\t\t\t\t\t\t]);\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\t// This requires waiting for finalizers.\n\t\t\t\t\t\t// Forcing two async GCs seems to work robustly, so this is enabled, but if it becomes flakey, it can be tweaked and/or skipped.\n\t\t\t\t\t\tit(`unsubscribe on unmount`, async () => {\n\t\t\t\t\t\t\tassert(global.gc);\n\n\t\t\t\t\t\t\tconst log: string[] = [];\n\n\t\t\t\t\t\t\tconst unsubscribe = (): void => {\n\t\t\t\t\t\t\t\tlog.push(\"unsubscribe\");\n\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\tfunction TestComponent(this: unknown): JSX.Element {\n\t\t\t\t\t\t\t\treturn useObservationHook((invalidate) => ({\n\t\t\t\t\t\t\t\t\tresult: <br />,\n\t\t\t\t\t\t\t\t\tunsubscribe,\n\t\t\t\t\t\t\t\t}));\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst rendered = render(<TestComponent />, { reactStrictMode });\n\n\t\t\t\t\t\t\tassertLogEmpty(log);\n\t\t\t\t\t\t\trendered.unmount();\n\n\t\t\t\t\t\t\t// Unsubscribe on unmount is done via FinalizationRegistry, so force a GC and wait for it.\n\t\t\t\t\t\t\t// For this to pass on NodeJs experimentally is has been found that this must either do:\n\t\t\t\t\t\t\t// 1. a sync GC then a wait of 8 seconds (but this sometimes fails after multiple runs unless a debugger takes a heap snapshot, possible due to some JIT optimization that breaks it).\n\t\t\t\t\t\t\t// 2. two async GCs in a row.\n\t\t\t\t\t\t\t// Since the second option is both more robust and faster, that is what is used here.\n\t\t\t\t\t\t\tfor (let index = 0; index < 2; index++) {\n\t\t\t\t\t\t\t\tawait global.gc({ type: \"major\", execution: \"async\" });\n\t\t\t\t\t\t\t\tif (log.length > 0) {\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tcheckRenderLog(log, [\"unsubscribe\"]);\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tit(\"invalidate after unmount\", () => {\n\t\t\t\t\t\t\tconst log: string[] = [];\n\n\t\t\t\t\t\t\tlet logUnsubscribe = true;\n\n\t\t\t\t\t\t\tconst unsubscribe = (): void => {\n\t\t\t\t\t\t\t\tif (logUnsubscribe) log.push(\"unsubscribe\");\n\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\tconst invalidateCallbacks: (() => void)[] = [];\n\n\t\t\t\t\t\t\tfunction TestComponent(): JSX.Element {\n\t\t\t\t\t\t\t\tlog.push(\"render\");\n\t\t\t\t\t\t\t\treturn useObservationHook(\n\t\t\t\t\t\t\t\t\t(invalidate) => {\n\t\t\t\t\t\t\t\t\t\tinvalidateCallbacks.push(invalidate);\n\t\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\t\tresult: <br />,\n\t\t\t\t\t\t\t\t\t\t\tunsubscribe,\n\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{ onInvalidation: () => log.push(\"invalidated\") },\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst rendered = render(<TestComponent />, { reactStrictMode });\n\n\t\t\t\t\t\t\tcheckRenderLog(log, [\"render\"]);\n\n\t\t\t\t\t\t\t// After unmount, unsubscribe could happen at any time due to finalizer,so suppress logging it to prevent the test from possibly becoming flaky.\n\t\t\t\t\t\t\tlogUnsubscribe = false;\n\n\t\t\t\t\t\t\trendered.unmount();\n\n\t\t\t\t\t\t\tassert(invalidateCallbacks.length === (reactStrictMode ? 2 : 1));\n\n\t\t\t\t\t\t\t// Invalidate after unmount.\n\t\t\t\t\t\t\t// Since this can happen in real use, due to unsubscribe delay while waiting for finalizer, ensure it does not cause issues.\n\t\t\t\t\t\t\t// This should be a no-op, but since it does a React SetState after unmount, React could object to it.\n\t\t\t\t\t\t\tfor (const callback of invalidateCallbacks) {\n\t\t\t\t\t\t\t\tcallback();\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Confirm the invalidation happened..\n\t\t\t\t\t\t\t// If we didn't suppress unsubscribe logging, and the finalizer had run, this could fail (which is why we suppress it).\n\t\t\t\t\t\t\tcheckRenderLog(log, [\"invalidated\"]);\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t});\n});\n\n/**\n * Assert that an array is empty.\n *\n * @remarks\n * Not inlined because doing so causes TypeScript to infer the array type as never[] afterwards and breaks push.\n * Better than asserting length is 0 as this gets a better error message on failure.\n */\nfunction assertLogEmpty(log: string[]): void {\n\tassert.deepEqual(log, []);\n}\n"]}
|
package/lib/test/useTree.spec.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
/*!
|
|
2
3
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
4
|
* Licensed under the MIT License.
|
|
@@ -6,7 +7,6 @@ import { strict as assert } from "node:assert";
|
|
|
6
7
|
import { SchemaFactory } from "@fluidframework/tree";
|
|
7
8
|
import { render } from "@testing-library/react";
|
|
8
9
|
import globalJsdom from "global-jsdom";
|
|
9
|
-
import * as React from "react";
|
|
10
10
|
import { toPropTreeNode } from "../propNode.js";
|
|
11
11
|
import { objectIdNumber } from "../simpleIdentifier.js";
|
|
12
12
|
import { usePropTreeNode, withMemoizedTreeObservations, withTreeObservations, } from "../useTree.js";
|
|
@@ -23,13 +23,13 @@ describe("useTree", () => {
|
|
|
23
23
|
const builder = new SchemaFactory("example");
|
|
24
24
|
class Item extends builder.object("Item", { text: SchemaFactory.string }) {
|
|
25
25
|
}
|
|
26
|
-
const ItemComponentBug = ({ item }) => (
|
|
26
|
+
const ItemComponentBug = ({ item }) => (_jsx("span", { children: item.text }) // Reading `text`, a mutable value from a React prop, causes an invalidation bug.
|
|
27
27
|
);
|
|
28
|
-
const ItemComponent = withTreeObservations(({ item }) =>
|
|
29
|
-
const ItemParentComponent = ({ item }) => (
|
|
28
|
+
const ItemComponent = withTreeObservations(({ item }) => _jsx("span", { children: item.text }));
|
|
29
|
+
const ItemParentComponent = ({ item }) => (_jsx(ItemComponent, { item: item }));
|
|
30
30
|
const InvalidItemParentComponent = ({ item, }) => (
|
|
31
31
|
// @ts-expect-error PropTreeNode turns this invalidation bug into a compile error
|
|
32
|
-
|
|
32
|
+
_jsx("span", { children: item.text }));
|
|
33
33
|
});
|
|
34
34
|
for (const reactStrictMode of [false, true]) {
|
|
35
35
|
/**
|
|
@@ -64,15 +64,15 @@ describe("useTree", () => {
|
|
|
64
64
|
y: node.y,
|
|
65
65
|
};
|
|
66
66
|
});
|
|
67
|
-
return
|
|
67
|
+
return _jsx("span", { children: `x: ${x}, y: ${y}` });
|
|
68
68
|
}
|
|
69
69
|
function ParentComponent(props) {
|
|
70
70
|
log.push("parent");
|
|
71
|
-
return
|
|
71
|
+
return _jsx(PointComponent, { node: props.node });
|
|
72
72
|
}
|
|
73
73
|
const point = new Point({ x: 1, y: 1 });
|
|
74
74
|
const propPoint = toPropTreeNode(point);
|
|
75
|
-
const content =
|
|
75
|
+
const content = _jsx(ParentComponent, { node: propPoint });
|
|
76
76
|
const rendered = render(content, { reactStrictMode });
|
|
77
77
|
assert.equal(rendered.baseElement.textContent, "x: 1, y: 1");
|
|
78
78
|
checkRenderLog(log, ["parent", "render", "usePropTreeNode"]);
|
|
@@ -101,27 +101,27 @@ describe("useTree", () => {
|
|
|
101
101
|
const log = [];
|
|
102
102
|
const ItemComponent = withMemoizedTreeObservations((props) => {
|
|
103
103
|
log.push(`Item: ${props.item.x}`);
|
|
104
|
-
return
|
|
104
|
+
return _jsx("span", { children: `${props.item.x}` });
|
|
105
105
|
}, { onInvalidation: () => log.push("Item invalidated") });
|
|
106
106
|
const CollectionComponent = withTreeObservations((props) => {
|
|
107
107
|
log.push("Collection");
|
|
108
|
-
const items = props.collection.map((item) => (
|
|
109
|
-
return
|
|
108
|
+
const items = props.collection.map((item) => (_jsx(ItemComponent, { item: item }, objectIdNumber(item))));
|
|
109
|
+
return _jsx("div", { children: items });
|
|
110
110
|
}, { onInvalidation: () => log.push("Collection invalidated") });
|
|
111
111
|
const ParentComponent = withTreeObservations((props) => {
|
|
112
112
|
log.push("Parent");
|
|
113
|
-
return
|
|
113
|
+
return _jsx(CollectionComponent, { collection: props.node });
|
|
114
114
|
}, { onInvalidation: () => log.push("Parent invalidated") });
|
|
115
115
|
it("empty", () => {
|
|
116
116
|
const collection = new Collection([]);
|
|
117
|
-
const content =
|
|
117
|
+
const content = _jsx(ParentComponent, { node: collection });
|
|
118
118
|
render(content, { reactStrictMode });
|
|
119
119
|
checkRenderLog(log, ["Parent", "Collection"]);
|
|
120
120
|
});
|
|
121
121
|
// This confirms that modifying an array does not needlessly invalid parents and reuses children (if they use memo)
|
|
122
122
|
it("array editing: insertion", () => {
|
|
123
123
|
const collection = new Collection([{ x: 1 }, { x: 2 }, { x: 3 }]);
|
|
124
|
-
const content =
|
|
124
|
+
const content = _jsx(ParentComponent, { node: collection });
|
|
125
125
|
const rendered = render(content, { reactStrictMode });
|
|
126
126
|
checkRenderLog(log, ["Parent", "Collection", "Item: 1", "Item: 2", "Item: 3"]);
|
|
127
127
|
collection.insertAtEnd(new Item({ x: 4 }));
|
|
@@ -134,7 +134,7 @@ describe("useTree", () => {
|
|
|
134
134
|
// For example this one depends on stable keys to reusing children due to indexes changing.
|
|
135
135
|
it("array editing: general", () => {
|
|
136
136
|
const collection = new Collection([{ x: 1 }, { x: 2 }, { x: 3 }]);
|
|
137
|
-
const content =
|
|
137
|
+
const content = _jsx(ParentComponent, { node: collection });
|
|
138
138
|
const rendered = render(content, { reactStrictMode });
|
|
139
139
|
checkRenderLog(log, ["Parent", "Collection", "Item: 1", "Item: 2", "Item: 3"]);
|
|
140
140
|
collection.moveToEnd(0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTree.spec.js","sourceRoot":"","sources":["../../src/test/useTree.spec.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,WAAW,MAAM,cAAc,CAAC;AACvC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,cAAc,EAAqB,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EACN,eAAe,EACf,4BAA4B,EAC5B,oBAAo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,CAAC,WAAW,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;gBACvD,CAAC,CAAC,CAAC;YACJ,CAAC,CAAC,CAAC;QACJ,CAAC;IACF,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH;;;;;GAKG;AACH,SAAS,cAAc,CAAC,GAAa;IACpC,MAAM,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;AAC3B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { strict as assert } from \"node:assert\";\n\nimport { SchemaFactory } from \"@fluidframework/tree\";\nimport { render } from \"@testing-library/react\";\nimport globalJsdom from \"global-jsdom\";\nimport * as React from \"react\";\n\nimport { toPropTreeNode, type PropTreeNode } from \"../propNode.js\";\nimport { objectIdNumber } from \"../simpleIdentifier.js\";\nimport {\n\tusePropTreeNode,\n\twithMemoizedTreeObservations,\n\twithTreeObservations,\n} from \"../useTree.js\";\n\ndescribe(\"useTree\", () => {\n\tdescribe(\"dom tests\", () => {\n\t\tlet cleanup: () => void;\n\n\t\tbefore(() => {\n\t\t\tcleanup = globalJsdom();\n\t\t});\n\n\t\tafter(() => {\n\t\t\tcleanup();\n\t\t});\n\n\t\tit(\"withTreeObservations example\", () => {\n\t\t\tconst builder = new SchemaFactory(\"example\");\n\t\t\tclass Item extends builder.object(\"Item\", { text: SchemaFactory.string }) {}\n\t\t\tconst ItemComponentBug = ({ item }: { item: Item }): JSX.Element => (\n\t\t\t\t<span>{item.text}</span> // Reading `text`, a mutable value from a React prop, causes an invalidation bug.\n\t\t\t);\n\n\t\t\tconst ItemComponent = withTreeObservations(\n\t\t\t\t({ item }: { item: Item }): JSX.Element => <span>{item.text}</span>,\n\t\t\t);\n\n\t\t\tconst ItemParentComponent = ({ item }: { item: PropTreeNode<Item> }): JSX.Element => (\n\t\t\t\t<ItemComponent item={item} />\n\t\t\t);\n\n\t\t\tconst InvalidItemParentComponent = ({\n\t\t\t\titem,\n\t\t\t}: {\n\t\t\t\titem: PropTreeNode<Item>;\n\t\t\t}): JSX.Element => (\n\t\t\t\t// @ts-expect-error PropTreeNode turns this invalidation bug into a compile error\n\t\t\t\t<span>{item.text}</span>\n\t\t\t);\n\t\t});\n\n\t\tfor (const reactStrictMode of [false, true]) {\n\t\t\t/**\n\t\t\t * Check then clear, the contents of `log`.\n\t\t\t *\n\t\t\t * When in StrictMode, React may double render, so that case is not checked for an exact match.\n\t\t\t */\n\t\t\tfunction checkRenderLog(log: string[], expected: readonly string[]): void {\n\t\t\t\tif (reactStrictMode) {\n\t\t\t\t\tassert.deepEqual(new Set(log), new Set(expected));\n\t\t\t\t} else {\n\t\t\t\t\tassert.deepEqual(log, expected);\n\t\t\t\t}\n\t\t\t\tlog.length = 0;\n\t\t\t}\n\n\t\t\tdescribe(`StrictMode: ${reactStrictMode}`, () => {\n\t\t\t\tit(\"usePropTreeNode\", () => {\n\t\t\t\t\tconst builder = new SchemaFactory(\"tree-react-api\");\n\n\t\t\t\t\tclass Point extends builder.object(\"Point\", {\n\t\t\t\t\t\tx: builder.number,\n\t\t\t\t\t\ty: builder.number,\n\t\t\t\t\t}) {}\n\n\t\t\t\t\tconst log: string[] = [];\n\n\t\t\t\t\tfunction PointComponent(props: { node: PropTreeNode<Point> }): JSX.Element {\n\t\t\t\t\t\tlog.push(\"render\");\n\t\t\t\t\t\tconst { x, y } = usePropTreeNode(props.node, (node) => {\n\t\t\t\t\t\t\tlog.push(`usePropTreeNode`);\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tx: node.x,\n\t\t\t\t\t\t\t\ty: node.y,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn <span>{`x: ${x}, y: ${y}`}</span>;\n\t\t\t\t\t}\n\n\t\t\t\t\tfunction ParentComponent(props: { node: PropTreeNode<Point> }): JSX.Element {\n\t\t\t\t\t\tlog.push(\"parent\");\n\t\t\t\t\t\treturn <PointComponent node={props.node} />;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst point = new Point({ x: 1, y: 1 });\n\t\t\t\t\tconst propPoint = toPropTreeNode(point);\n\n\t\t\t\t\tconst content = <ParentComponent node={propPoint} />;\n\n\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\t\t\t\t\tassert.equal(rendered.baseElement.textContent, \"x: 1, y: 1\");\n\t\t\t\t\tcheckRenderLog(log, [\"parent\", \"render\", \"usePropTreeNode\"]);\n\n\t\t\t\t\trendered.rerender(content);\n\t\t\t\t\tassertLogEmpty(log);\n\n\t\t\t\t\tpoint.x = 2;\n\t\t\t\t\tassertLogEmpty(log);\n\t\t\t\t\trendered.rerender(content);\n\t\t\t\t\t// Parent which passed node down did not rerender, but PointComponent which read from it did:\n\t\t\t\t\tcheckRenderLog(log, [\"render\", \"usePropTreeNode\"]);\n\t\t\t\t\tassert.equal(rendered.baseElement.textContent, \"x: 2, y: 1\");\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tdescribe(\"withTreeObservations and array\", () => {\n\t\t\t\tconst builder = new SchemaFactory(\"tree-react-api\");\n\n\t\t\t\tclass Item extends builder.object(\"Item\", {\n\t\t\t\t\tx: SchemaFactory.number,\n\t\t\t\t}) {}\n\n\t\t\t\tclass Collection extends builder.array(\"Collection\", Item) {}\n\n\t\t\t\tbeforeEach(() => {\n\t\t\t\t\t// Ensure the log starts empty for each test.\n\t\t\t\t\tlog.length = 0;\n\t\t\t\t});\n\n\t\t\t\tconst log: string[] = [];\n\n\t\t\t\tconst ItemComponent = withMemoizedTreeObservations(\n\t\t\t\t\t(props: { item: Item }): JSX.Element => {\n\t\t\t\t\t\tlog.push(`Item: ${props.item.x}`);\n\t\t\t\t\t\treturn <span>{`${props.item.x}`}</span>;\n\t\t\t\t\t},\n\t\t\t\t\t{ onInvalidation: () => log.push(\"Item invalidated\") },\n\t\t\t\t);\n\n\t\t\t\tconst CollectionComponent = withTreeObservations(\n\t\t\t\t\t(props: { collection: Collection }): JSX.Element => {\n\t\t\t\t\t\tlog.push(\"Collection\");\n\n\t\t\t\t\t\tconst items = props.collection.map((item) => (\n\t\t\t\t\t\t\t<ItemComponent key={objectIdNumber(item)} item={item} />\n\t\t\t\t\t\t));\n\n\t\t\t\t\t\treturn <div>{items}</div>;\n\t\t\t\t\t},\n\t\t\t\t\t{ onInvalidation: () => log.push(\"Collection invalidated\") },\n\t\t\t\t);\n\n\t\t\t\tconst ParentComponent = withTreeObservations(\n\t\t\t\t\t(props: { node: Collection }): JSX.Element => {\n\t\t\t\t\t\tlog.push(\"Parent\");\n\t\t\t\t\t\treturn <CollectionComponent collection={props.node} />;\n\t\t\t\t\t},\n\t\t\t\t\t{ onInvalidation: () => log.push(\"Parent invalidated\") },\n\t\t\t\t);\n\n\t\t\t\tit(\"empty\", () => {\n\t\t\t\t\tconst collection = new Collection([]);\n\t\t\t\t\tconst content = <ParentComponent node={collection} />;\n\t\t\t\t\trender(content, { reactStrictMode });\n\t\t\t\t\tcheckRenderLog(log, [\"Parent\", \"Collection\"]);\n\t\t\t\t});\n\n\t\t\t\t// This confirms that modifying an array does not needlessly invalid parents and reuses children (if they use memo)\n\t\t\t\tit(\"array editing: insertion\", () => {\n\t\t\t\t\tconst collection = new Collection([{ x: 1 }, { x: 2 }, { x: 3 }]);\n\t\t\t\t\tconst content = <ParentComponent node={collection} />;\n\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\t\t\t\t\tcheckRenderLog(log, [\"Parent\", \"Collection\", \"Item: 1\", \"Item: 2\", \"Item: 3\"]);\n\t\t\t\t\tcollection.insertAtEnd(new Item({ x: 4 }));\n\t\t\t\t\tcheckRenderLog(log, [\"Collection invalidated\"]);\n\t\t\t\t\trendered.rerender(content);\n\t\t\t\t\tcheckRenderLog(log, [\"Collection\", \"Item: 4\"]);\n\n\t\t\t\t\tassert.equal(rendered.baseElement.textContent, \"1234\");\n\t\t\t\t});\n\n\t\t\t\t// This confirms the same as the above, but testes some harder cases.\n\t\t\t\t// For example this one depends on stable keys to reusing children due to indexes changing.\n\t\t\t\tit(\"array editing: general\", () => {\n\t\t\t\t\tconst collection = new Collection([{ x: 1 }, { x: 2 }, { x: 3 }]);\n\t\t\t\t\tconst content = <ParentComponent node={collection} />;\n\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\t\t\t\t\tcheckRenderLog(log, [\"Parent\", \"Collection\", \"Item: 1\", \"Item: 2\", \"Item: 3\"]);\n\t\t\t\t\tcollection.moveToEnd(0);\n\t\t\t\t\tcheckRenderLog(log, [\"Collection invalidated\"]);\n\t\t\t\t\trendered.rerender(content);\n\t\t\t\t\tcheckRenderLog(log, [\"Collection\"]);\n\t\t\t\t\tcollection.removeAt(1);\n\t\t\t\t\tcollection.insertAtStart(new Item({ x: 4 }));\n\t\t\t\t\tcheckRenderLog(log, [\"Collection invalidated\"]);\n\t\t\t\t\trendered.rerender(content);\n\t\t\t\t\tcheckRenderLog(log, [\"Collection\", \"Item: 4\"]);\n\n\t\t\t\t\tassert.equal(rendered.baseElement.textContent, \"421\");\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t});\n});\n\n/**\n * Assert that an array is empty.\n *\n * Not inlined because doing so causes TypeScript to infer the array type as never[] afterwards and breaks push.\n * Better than asserting length is 0 as this gets a better error message on failure.\n */\nfunction assertLogEmpty(log: string[]): void {\n\tassert.deepEqual(log, []);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"useTree.spec.js","sourceRoot":"","sources":["../../src/test/useTree.spec.tsx"],"names":[],"mappings":";AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,WAAW,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,cAAc,EAAqB,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,c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SAAS,CAAC,CAAC,CAAC;oBAE/C,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;gBACvD,CAAC,CAAC,CAAC;YACJ,CAAC,CAAC,CAAC;QACJ,CAAC;IACF,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH;;;;;GAKG;AACH,SAAS,cAAc,CAAC,GAAa;IACpC,MAAM,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;AAC3B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { strict as assert } from \"node:assert\";\n\nimport { SchemaFactory } from \"@fluidframework/tree\";\nimport { render } from \"@testing-library/react\";\nimport globalJsdom from \"global-jsdom\";\n\nimport { toPropTreeNode, type PropTreeNode } from \"../propNode.js\";\nimport { objectIdNumber } from \"../simpleIdentifier.js\";\nimport {\n\tusePropTreeNode,\n\twithMemoizedTreeObservations,\n\twithTreeObservations,\n} from \"../useTree.js\";\n\ndescribe(\"useTree\", () => {\n\tdescribe(\"dom tests\", () => {\n\t\tlet cleanup: () => void;\n\n\t\tbefore(() => {\n\t\t\tcleanup = globalJsdom();\n\t\t});\n\n\t\tafter(() => {\n\t\t\tcleanup();\n\t\t});\n\n\t\tit(\"withTreeObservations example\", () => {\n\t\t\tconst builder = new SchemaFactory(\"example\");\n\t\t\tclass Item extends builder.object(\"Item\", { text: SchemaFactory.string }) {}\n\t\t\tconst ItemComponentBug = ({ item }: { item: Item }): JSX.Element => (\n\t\t\t\t<span>{item.text}</span> // Reading `text`, a mutable value from a React prop, causes an invalidation bug.\n\t\t\t);\n\n\t\t\tconst ItemComponent = withTreeObservations(\n\t\t\t\t({ item }: { item: Item }): JSX.Element => <span>{item.text}</span>,\n\t\t\t);\n\n\t\t\tconst ItemParentComponent = ({ item }: { item: PropTreeNode<Item> }): JSX.Element => (\n\t\t\t\t<ItemComponent item={item} />\n\t\t\t);\n\n\t\t\tconst InvalidItemParentComponent = ({\n\t\t\t\titem,\n\t\t\t}: {\n\t\t\t\titem: PropTreeNode<Item>;\n\t\t\t}): JSX.Element => (\n\t\t\t\t// @ts-expect-error PropTreeNode turns this invalidation bug into a compile error\n\t\t\t\t<span>{item.text}</span>\n\t\t\t);\n\t\t});\n\n\t\tfor (const reactStrictMode of [false, true]) {\n\t\t\t/**\n\t\t\t * Check then clear, the contents of `log`.\n\t\t\t *\n\t\t\t * When in StrictMode, React may double render, so that case is not checked for an exact match.\n\t\t\t */\n\t\t\tfunction checkRenderLog(log: string[], expected: readonly string[]): void {\n\t\t\t\tif (reactStrictMode) {\n\t\t\t\t\tassert.deepEqual(new Set(log), new Set(expected));\n\t\t\t\t} else {\n\t\t\t\t\tassert.deepEqual(log, expected);\n\t\t\t\t}\n\t\t\t\tlog.length = 0;\n\t\t\t}\n\n\t\t\tdescribe(`StrictMode: ${reactStrictMode}`, () => {\n\t\t\t\tit(\"usePropTreeNode\", () => {\n\t\t\t\t\tconst builder = new SchemaFactory(\"tree-react-api\");\n\n\t\t\t\t\tclass Point extends builder.object(\"Point\", {\n\t\t\t\t\t\tx: builder.number,\n\t\t\t\t\t\ty: builder.number,\n\t\t\t\t\t}) {}\n\n\t\t\t\t\tconst log: string[] = [];\n\n\t\t\t\t\tfunction PointComponent(props: { node: PropTreeNode<Point> }): JSX.Element {\n\t\t\t\t\t\tlog.push(\"render\");\n\t\t\t\t\t\tconst { x, y } = usePropTreeNode(props.node, (node) => {\n\t\t\t\t\t\t\tlog.push(`usePropTreeNode`);\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tx: node.x,\n\t\t\t\t\t\t\t\ty: node.y,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn <span>{`x: ${x}, y: ${y}`}</span>;\n\t\t\t\t\t}\n\n\t\t\t\t\tfunction ParentComponent(props: { node: PropTreeNode<Point> }): JSX.Element {\n\t\t\t\t\t\tlog.push(\"parent\");\n\t\t\t\t\t\treturn <PointComponent node={props.node} />;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst point = new Point({ x: 1, y: 1 });\n\t\t\t\t\tconst propPoint = toPropTreeNode(point);\n\n\t\t\t\t\tconst content = <ParentComponent node={propPoint} />;\n\n\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\t\t\t\t\tassert.equal(rendered.baseElement.textContent, \"x: 1, y: 1\");\n\t\t\t\t\tcheckRenderLog(log, [\"parent\", \"render\", \"usePropTreeNode\"]);\n\n\t\t\t\t\trendered.rerender(content);\n\t\t\t\t\tassertLogEmpty(log);\n\n\t\t\t\t\tpoint.x = 2;\n\t\t\t\t\tassertLogEmpty(log);\n\t\t\t\t\trendered.rerender(content);\n\t\t\t\t\t// Parent which passed node down did not rerender, but PointComponent which read from it did:\n\t\t\t\t\tcheckRenderLog(log, [\"render\", \"usePropTreeNode\"]);\n\t\t\t\t\tassert.equal(rendered.baseElement.textContent, \"x: 2, y: 1\");\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tdescribe(\"withTreeObservations and array\", () => {\n\t\t\t\tconst builder = new SchemaFactory(\"tree-react-api\");\n\n\t\t\t\tclass Item extends builder.object(\"Item\", {\n\t\t\t\t\tx: SchemaFactory.number,\n\t\t\t\t}) {}\n\n\t\t\t\tclass Collection extends builder.array(\"Collection\", Item) {}\n\n\t\t\t\tbeforeEach(() => {\n\t\t\t\t\t// Ensure the log starts empty for each test.\n\t\t\t\t\tlog.length = 0;\n\t\t\t\t});\n\n\t\t\t\tconst log: string[] = [];\n\n\t\t\t\tconst ItemComponent = withMemoizedTreeObservations(\n\t\t\t\t\t(props: { item: Item }): JSX.Element => {\n\t\t\t\t\t\tlog.push(`Item: ${props.item.x}`);\n\t\t\t\t\t\treturn <span>{`${props.item.x}`}</span>;\n\t\t\t\t\t},\n\t\t\t\t\t{ onInvalidation: () => log.push(\"Item invalidated\") },\n\t\t\t\t);\n\n\t\t\t\tconst CollectionComponent = withTreeObservations(\n\t\t\t\t\t(props: { collection: Collection }): JSX.Element => {\n\t\t\t\t\t\tlog.push(\"Collection\");\n\n\t\t\t\t\t\tconst items = props.collection.map((item) => (\n\t\t\t\t\t\t\t<ItemComponent key={objectIdNumber(item)} item={item} />\n\t\t\t\t\t\t));\n\n\t\t\t\t\t\treturn <div>{items}</div>;\n\t\t\t\t\t},\n\t\t\t\t\t{ onInvalidation: () => log.push(\"Collection invalidated\") },\n\t\t\t\t);\n\n\t\t\t\tconst ParentComponent = withTreeObservations(\n\t\t\t\t\t(props: { node: Collection }): JSX.Element => {\n\t\t\t\t\t\tlog.push(\"Parent\");\n\t\t\t\t\t\treturn <CollectionComponent collection={props.node} />;\n\t\t\t\t\t},\n\t\t\t\t\t{ onInvalidation: () => log.push(\"Parent invalidated\") },\n\t\t\t\t);\n\n\t\t\t\tit(\"empty\", () => {\n\t\t\t\t\tconst collection = new Collection([]);\n\t\t\t\t\tconst content = <ParentComponent node={collection} />;\n\t\t\t\t\trender(content, { reactStrictMode });\n\t\t\t\t\tcheckRenderLog(log, [\"Parent\", \"Collection\"]);\n\t\t\t\t});\n\n\t\t\t\t// This confirms that modifying an array does not needlessly invalid parents and reuses children (if they use memo)\n\t\t\t\tit(\"array editing: insertion\", () => {\n\t\t\t\t\tconst collection = new Collection([{ x: 1 }, { x: 2 }, { x: 3 }]);\n\t\t\t\t\tconst content = <ParentComponent node={collection} />;\n\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\t\t\t\t\tcheckRenderLog(log, [\"Parent\", \"Collection\", \"Item: 1\", \"Item: 2\", \"Item: 3\"]);\n\t\t\t\t\tcollection.insertAtEnd(new Item({ x: 4 }));\n\t\t\t\t\tcheckRenderLog(log, [\"Collection invalidated\"]);\n\t\t\t\t\trendered.rerender(content);\n\t\t\t\t\tcheckRenderLog(log, [\"Collection\", \"Item: 4\"]);\n\n\t\t\t\t\tassert.equal(rendered.baseElement.textContent, \"1234\");\n\t\t\t\t});\n\n\t\t\t\t// This confirms the same as the above, but testes some harder cases.\n\t\t\t\t// For example this one depends on stable keys to reusing children due to indexes changing.\n\t\t\t\tit(\"array editing: general\", () => {\n\t\t\t\t\tconst collection = new Collection([{ x: 1 }, { x: 2 }, { x: 3 }]);\n\t\t\t\t\tconst content = <ParentComponent node={collection} />;\n\t\t\t\t\tconst rendered = render(content, { reactStrictMode });\n\t\t\t\t\tcheckRenderLog(log, [\"Parent\", \"Collection\", \"Item: 1\", \"Item: 2\", \"Item: 3\"]);\n\t\t\t\t\tcollection.moveToEnd(0);\n\t\t\t\t\tcheckRenderLog(log, [\"Collection invalidated\"]);\n\t\t\t\t\trendered.rerender(content);\n\t\t\t\t\tcheckRenderLog(log, [\"Collection\"]);\n\t\t\t\t\tcollection.removeAt(1);\n\t\t\t\t\tcollection.insertAtStart(new Item({ x: 4 }));\n\t\t\t\t\tcheckRenderLog(log, [\"Collection invalidated\"]);\n\t\t\t\t\trendered.rerender(content);\n\t\t\t\t\tcheckRenderLog(log, [\"Collection\", \"Item: 4\"]);\n\n\t\t\t\t\tassert.equal(rendered.baseElement.textContent, \"421\");\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t});\n});\n\n/**\n * Assert that an array is empty.\n *\n * Not inlined because doing so causes TypeScript to infer the array type as never[] afterwards and breaks push.\n * Better than asserting length is 0 as this gets a better error message on failure.\n */\nfunction assertLogEmpty(log: string[]): void {\n\tassert.deepEqual(log, []);\n}\n"]}
|
package/lib/text/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
5
|
+
export { type PropTreeNode } from "../propNode.js";
|
|
6
|
+
export { type UndoRedo } from "../undoRedo.js";
|
|
7
|
+
export { PlainTextMainView, syncTextToTree } from "./plain/index.js";
|
|
7
8
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/text/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/text/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/text/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
|
package/lib/text/index.js
CHANGED
|
@@ -2,6 +2,5 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
export {
|
|
6
|
-
export { PlainTextMainView, QuillMainView as PlainQuillView, } from "./plain/index.js";
|
|
5
|
+
export { PlainTextMainView, syncTextToTree } from "./plain/index.js";
|
|
7
6
|
//# sourceMappingURL=index.js.map
|
package/lib/text/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/text/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/text/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { type PropTreeNode } from \"../propNode.js\";\nexport { type UndoRedo } from \"../undoRedo.js\";\nexport { PlainTextMainView, syncTextToTree } from \"./plain/index.js\";\n"]}
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
export { MainView as PlainTextMainView } from "./plainTextView.js";
|
|
6
|
-
export {
|
|
6
|
+
export { syncTextToTree } from "./plainUtils.js";
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/text/plain/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,IAAI,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/text/plain/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,IAAI,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC"}
|
package/lib/text/plain/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/text/plain/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,IAAI,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/text/plain/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,IAAI,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { MainView as PlainTextMainView } from \"./plainTextView.js\";\nexport { syncTextToTree } from \"./plainUtils.js\";\n"]}
|
|
@@ -2,13 +2,16 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
6
|
-
import type
|
|
5
|
+
import type { TextAsTree } from "@fluidframework/tree/internal";
|
|
6
|
+
import { type FC } from "react";
|
|
7
|
+
import type { PropTreeNode } from "../../propNode.js";
|
|
7
8
|
/**
|
|
8
9
|
* A React component for plain text editing.
|
|
9
10
|
* @remarks
|
|
10
11
|
* Uses {@link @fluidframework/tree#TextAsTree.Tree} for the data-model and an HTML textarea for the UI.
|
|
11
12
|
* @internal
|
|
12
13
|
*/
|
|
13
|
-
export declare const MainView:
|
|
14
|
+
export declare const MainView: FC<{
|
|
15
|
+
root: PropTreeNode<TextAsTree.Tree>;
|
|
16
|
+
}>;
|
|
14
17
|
//# sourceMappingURL=plainTextView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plainTextView.d.ts","sourceRoot":"","sources":["../../../src/text/plain/plainTextView.tsx"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"plainTextView.d.ts","sourceRoot":"","sources":["../../../src/text/plain/plainTextView.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAoB,KAAK,EAAE,EAAuB,MAAM,OAAO,CAAC;AAEvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAKtD;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC;IAAE,IAAI,EAAE,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;CAAE,CAEhE,CAAC"}
|