forked from deriv-com/deriv-app
-
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.
likhith/feat:incorporated string normalization to match non english c…
…haracters (deriv-com#7649) * feat: ⚡ incorporated string normalization to match non english character * fix: ensuring non english character match * feat: resolved import issue * feat: incorporated helper function * feat: added testcases for helper function * feat: incorporated helper function to all case * feat: 🎨 refactored code * feat: code refactor --------- Co-authored-by: Matin shafiei <matin@deriv.com> Co-authored-by: Carol Sachdeva <58209918+carol-deriv@users.noreply.github.com>
- Loading branch information
1 parent
ff2f1c5
commit 228f80f
Showing
3 changed files
with
29 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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const { getEnglishCharacters } = require('../helper'); | ||
|
||
describe('Utility/Helper', () => { | ||
it('should return english alphabets removing special characters', () => { | ||
const test_input = 'Ai Cập'; | ||
const test_result = 'Ai Cap'; | ||
|
||
expect(getEnglishCharacters(test_input)).toMatch(test_result); | ||
}); | ||
|
||
it('should return empty string if the text contains no english characters', () => { | ||
const test_input = '埃及'; | ||
const test_result = ''; | ||
|
||
expect(getEnglishCharacters(test_input)).toMatch(test_result); | ||
}); | ||
}); |
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