-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Farhood Shapouran
committed
Mar 28, 2023
1 parent
9858bb7
commit fb5f496
Showing
1 changed file
with
20 additions
and
38 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 |
---|---|---|
|
@@ -6,54 +6,36 @@ import { | |
} from '../regexes'; | ||
|
||
it('Check the input is a Mention', () => { | ||
expect(mentionRegexTester.test('@farhoodme')).toBeTruthy(); | ||
expect('@farhoodme').toMatch(mentionRegexTester); | ||
}); | ||
|
||
it('Check the input is a Hashtag', () => { | ||
expect(hashtagRegexTester.test('#test')).toBeTruthy(); | ||
}); | ||
|
||
it('Check the input is a Hashtag', () => { | ||
expect(hashtagRegexTester.test('#şikayet')).toBeTruthy(); | ||
}); | ||
|
||
it('Check the input is a Hashtag', () => { | ||
expect(hashtagRegexTester.test('تست#')).toBeTruthy(); | ||
}); | ||
|
||
it('Check the input is a Hashtag', () => { | ||
expect(hashtagRegexTester.test('#测试')).toBeTruthy(); | ||
}); | ||
|
||
it('Check the input is a Hashtag', () => { | ||
expect(hashtagRegexTester.test('#тест')).toBeTruthy(); | ||
}); | ||
|
||
it('Check the input is a Hashtag', () => { | ||
expect(hashtagRegexTester.test('#prüfen')).toBeTruthy(); | ||
expect('#test').toMatch(hashtagRegexTester); | ||
expect('#şikayet').toMatch(hashtagRegexTester); | ||
expect('تست#').toMatch(hashtagRegexTester); | ||
expect('#测试').toMatch(hashtagRegexTester); | ||
expect('#тест').toMatch(hashtagRegexTester); | ||
expect('#prüfen').toMatch(hashtagRegexTester); | ||
}); | ||
|
||
it('Check the input not a Hashtag', () => { | ||
expect(hashtagRegexTester.test('test#test')).toBeFalsy(); | ||
expect('test#test').not.toMatch(hashtagRegexTester); | ||
}); | ||
|
||
it('Check the input is an Email Address', () => { | ||
expect(emailRegexTester.test('[email protected]')).toBeTruthy(); | ||
expect('[email protected]').toMatch(emailRegexTester); | ||
expect('[email protected]').toMatch(emailRegexTester); | ||
}); | ||
|
||
it('Check the input is an Url', () => { | ||
expect( | ||
urlRegexTester.test( | ||
'https://www.asd.google.com/search?q=some+text¶m=3#dfsdf' | ||
) | ||
).toBeTruthy(); | ||
expect(urlRegexTester.test('http://www.google.com')).toBeTruthy(); | ||
expect(urlRegexTester.test('www.google.com')).toBeTruthy(); | ||
expect( | ||
urlRegexTester.test('https://google.com/?q=some+text¶m=3#dfsdf') | ||
).toBeTruthy(); | ||
expect(urlRegexTester.test('https://www.google.com/api/')).toBeTruthy(); | ||
expect( | ||
urlRegexTester.test('https://www.google.com/api/login.php') | ||
).toBeTruthy(); | ||
expect('https://www.asd.google.com/search?q=some+text¶m=3#dfsdf').toMatch( | ||
urlRegexTester | ||
); | ||
expect('http://www.google.com').toMatch(urlRegexTester); | ||
expect('www.google.com').toMatch(urlRegexTester); | ||
expect('https://google.com/?q=some+text¶m=3#dfsdf').toMatch( | ||
urlRegexTester | ||
); | ||
expect('https://www.google.com/api/').toMatch(urlRegexTester); | ||
expect('https://www.google.com/api/login.php').toMatch(urlRegexTester); | ||
}); |