@@ -30,5 +30,29 @@ describe('Text', () => {
30
30
const result = uut . getTextPartsByHighlight ( 'Dancing in the Dark' , 'da' ) ;
31
31
expect ( result ) . toEqual ( [ 'Da' , 'ncing in the ' , 'Da' , 'rk' ] ) ;
32
32
} ) ;
33
+
34
+ it ( 'Should handle special characters @' , ( ) => {
35
+ const uut = new Text ( { } ) ;
36
+ const result = uut . getTextPartsByHighlight ( '@ancing in the @ark' , '@a' ) ;
37
+ expect ( result ) . toEqual ( [ '@a' , 'ncing in the ' , '@a' , 'rk' ] ) ;
38
+ } ) ;
39
+
40
+ it ( 'Should handle special characters !' , ( ) => {
41
+ const uut = new Text ( { } ) ;
42
+ const result = uut . getTextPartsByHighlight ( '!ancing in the !ark' , '!a' ) ;
43
+ expect ( result ) . toEqual ( [ '!a' , 'ncing in the ' , '!a' , 'rk' ] ) ;
44
+ } ) ;
45
+
46
+ it ( 'Should handle special characters starts with @' , ( ) => {
47
+ const uut = new Text ( { } ) ;
48
+ const result = uut . getTextPartsByHighlight ( '[email protected] ' , '@wix' ) ;
49
+ expect ( result ) . toEqual ( [ 'uilib' , '@wix' , '.com' ] ) ;
50
+ } ) ;
51
+
52
+ it ( 'Should handle empty string .' , ( ) => {
53
+ const uut = new Text ( { } ) ;
54
+ const result = uut . getTextPartsByHighlight ( '@ancing in the @ark' , '' ) ;
55
+ expect ( result ) . toEqual ( [ '@ancing in the @ark' ] ) ;
56
+ } ) ;
33
57
} ) ;
34
58
} ) ;
0 commit comments