forked from Doist/typist
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(factories): Allow alphanumeric IDs for suggestion nodes in `creat…
…eSuggestionExtension` (Doist#66)
- Loading branch information
Showing
10 changed files
with
174 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -565,6 +565,19 @@ Answer: [Doist Frontend](channel://190200)`), | |
}) | ||
|
||
describe('with custom `*Suggestion` extensions', () => { | ||
test('suggestion extensions support alphanumeric IDs', () => { | ||
const customSerializer = createHTMLSerializer( | ||
getSchema([RichTextKit, createSuggestionExtension('mention')]), | ||
) | ||
|
||
expect( | ||
customSerializer.serialize(`Question: Who's the head of the Frontend team? | ||
Answer: [Henning M](mention://user:[email protected])`), | ||
).toBe( | ||
'<p>Question: Who\'s the head of the Frontend team?<br>Answer: <span data-mention="" data-id="user:[email protected]" data-label="Henning M"></span></p>', | ||
) | ||
}) | ||
|
||
test('mention suggestions HTML output is correct', () => { | ||
const customSerializer = createHTMLSerializer( | ||
getSchema([RichTextKit, createSuggestionExtension('mention')]), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.