stable

Clone or download

Read-only

refactor: unit test insertion of link popovers

story #38627 : Choice of a new Rich Text Editor Note: 22 unit-tests have been added to cover as much as possible the insertion of link popovers. In order to ease the unit tests, I had to split the code in several class-like object, with their corresponding types. It allows us to stub the prose-mirror stuff in the unit tests of our business code, which is kind of cool given the difficulty to manipulate EditorState and EditorView oustside a real editor. -- no functional change expected. Change-Id: Ibacf8df0b959b1fc71b309d276724e248d7e7681

Modified Files

Name
A lib/frontend/prose-mirror-editor/src/plugins/link-popover/helper/CrossReferenceNodeDetector.test.ts +49 −0 Go to diff View file
A lib/frontend/prose-mirror-editor/src/plugins/link-popover/helper/CrossReferenceNodeDetector.ts +27 −0 Go to diff View file
A lib/frontend/prose-mirror-editor/src/plugins/link-popover/helper/CrossReferenceUrlExtractor.test.ts +44 −0 Go to diff View file
A lib/frontend/prose-mirror-editor/src/plugins/link-popover/helper/CrossReferenceUrlExtractor.ts +26 −0 Go to diff View file
A lib/frontend/prose-mirror-editor/src/plugins/link-popover/helper/DOMNodeAtPositionFinder.test.ts +42 −0 Go to diff View file
A lib/frontend/prose-mirror-editor/src/plugins/link-popover/helper/DOMNodeAtPositionFinder.ts +28 −0 Go to diff View file
A lib/frontend/prose-mirror-editor/src/plugins/link-popover/helper/EditorNodeAtPositionFinder.test.ts +40 −0 Go to diff View file
R lib/frontend/prose-mirror-editor/src/plugins/link-popover/helper/link-value-extractor.ts Go to diff View file
A lib/frontend/prose-mirror-editor/src/plugins/link-popover/helper/EmptySelectionChecker.test.ts +33 −0 Go to diff View file
A lib/frontend/prose-mirror-editor/src/plugins/link-popover/helper/EmptySelectionChecker.ts +28 −0 Go to diff View file
A lib/frontend/prose-mirror-editor/src/plugins/link-popover/helper/LinkNodeDetector.test.ts +61 −0 Go to diff View file
A lib/frontend/prose-mirror-editor/src/plugins/link-popover/helper/LinkNodeDetector.ts +29 −0 Go to diff View file
A lib/frontend/prose-mirror-editor/src/plugins/link-popover/helper/LinkPopoverInserter.test.ts +136 −0 Go to diff View file
A lib/frontend/prose-mirror-editor/src/plugins/link-popover/helper/LinkPopoverInserter.ts +85 −0 Go to diff View file
A lib/frontend/prose-mirror-editor/src/plugins/link-popover/helper/LinkUrlExtractor.test.ts +77 −0 Go to diff View file
A lib/frontend/prose-mirror-editor/src/plugins/link-popover/helper/LinkUrlExtractor.ts +44 −0 Go to diff View file
R lib/frontend/prose-mirror-editor/src/plugins/link-popover/helper/link-popover-inserter.test.ts Go to diff View file
R lib/frontend/prose-mirror-editor/src/plugins/link-popover/helper/link-popover-inserter.ts Go to diff View file
D lib/frontend/prose-mirror-editor/src/plugins/link-popover/helper/link-value-extractor.test.ts +0 −58 Go to diff View file
A lib/frontend/prose-mirror-editor/src/plugins/link-popover/helper/stubs/DetectLinkNodeStub.ts +29 −0 Go to diff View file
A lib/frontend/prose-mirror-editor/src/plugins/link-popover/helper/stubs/EditorLinkNodeUrlExtractorStub.ts +29 −0 Go to diff View file
A lib/frontend/prose-mirror-editor/src/plugins/link-popover/helper/stubs/EmptySelectionCheckerStub.ts +29 −0 Go to diff View file
A lib/frontend/prose-mirror-editor/src/plugins/link-popover/helper/stubs/FindDOMNodeAtPositionStub.ts +26 −0 Go to diff View file
A lib/frontend/prose-mirror-editor/src/plugins/link-popover/helper/stubs/FindEditorNodeAtPositionStub.ts +30 −0 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/link-popover/link-popover.ts +28 −50 Go to diff View file
A lib/frontend/prose-mirror-editor/src/types/internal-types.ts +25 −0 Go to diff View file
M lib/frontend/prose-mirror-editor/src/use-editor.ts +1 −1 Go to diff View file