-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add handling possible short mentions tags to ExpensiMark
- Loading branch information
Showing
3 changed files
with
39 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
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,4 +1,4 @@ | ||
/* eslint-disable max-len */ | ||
/* eslint-disable max-len,no-useless-concat */ | ||
import ExpensiMark from '../lib/ExpensiMark'; | ||
|
||
const parser = new ExpensiMark(); | ||
|
@@ -931,6 +931,7 @@ test('Test urls autolinks correctly', () => { | |
}, | ||
]; | ||
|
||
// Fixme @expensify.com is a now correct "possible" short mention | ||
testCases.forEach((testCase) => { | ||
expect(parser.replace(testCase.testString)).toBe(testCase.resultString); | ||
}); | ||
|
@@ -1320,6 +1321,16 @@ test('Test for user mention with @[email protected]', () => { | |
const resultString = '<mention-user>@[email protected]</mention-user>'; | ||
expect(parser.replace(testString)).toBe(resultString); | ||
}); | ||
// Todo | ||
// popraw psujący się @here testy | ||
// Todo wszystkie edge kejsy w których short mention jest ambiguous | ||
// short-mention -> possible-short-mention | ||
|
||
test('Test for short mention mention with @[email protected]', () => { | ||
const testString = '@john.doe'; | ||
const resultString = '<mention-short>@john.doe</mention-short>'; | ||
expect(parser.replace(testString)).toBe(resultString); | ||
}); | ||
|
||
test('Test for user mention with @@[email protected]', () => { | ||
const testString = '@@[email protected]'; | ||
|
@@ -1372,7 +1383,7 @@ test('Test for user mention without leading whitespace', () => { | |
|
||
test('Test for user mention with @username@expensify', () => { | ||
const testString = '@username@expensify'; | ||
const resultString = '@username@expensify'; | ||
const resultString = '<mention-short>@username</mention-short><mention-short>@expensify</mention-short>'; | ||
expect(parser.replace(testString)).toBe(resultString); | ||
}); | ||
|
||
|
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