forked from GetStream/stream-chat-react
-
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(renderText): special case @ symbol at the end of the message (Get…
…Stream#1873) * fix: handle special case of @ symbol at the end of the message * test: add test for special case with @ symbol
- Loading branch information
1 parent
6ec31af
commit 7dced57
Showing
3 changed files
with
22 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,17 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`renderText handles the special case where there's at least one mention and @ symbol at the end 1`] = ` | ||
<p> | ||
<span | ||
className="str-chat__message-mention" | ||
data-user-id="[email protected]" | ||
> | ||
@[email protected] | ||
</span> | ||
@ | ||
</p> | ||
`; | ||
|
||
exports[`renderText handles the special case where user name matches to an e-mail pattern - 1 1`] = ` | ||
<p> | ||
Hello | ||
|
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 |
---|---|---|
|
@@ -80,4 +80,12 @@ describe(`renderText`, () => { | |
const tree = renderer.create(Markdown).toJSON(); | ||
expect(tree).toMatchSnapshot(); | ||
}); | ||
|
||
it("handles the special case where there's at least one mention and @ symbol at the end", () => { | ||
const Markdown = renderText('@[email protected] @', [ | ||
{ id: '[email protected]', name: '[email protected]' }, | ||
]); | ||
const tree = renderer.create(Markdown).toJSON(); | ||
expect(tree).toMatchSnapshot(); | ||
}); | ||
}); |
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