@@ -92,7 +92,7 @@ describe('Directive: Mask with Textarea', () => {
9292 component . clearIfNotMatch . set ( true ) ;
9393 equalTextarea ( '123' , '123' , fixture ) ;
9494 equalTextarea ( '12345678' , '1234-5678' , fixture ) ;
95- equalTextarea ( 'abc' , '' , fixture ) ; // Should clear if doesn't match
95+ equalTextarea ( 'abc' , '' , fixture ) ;
9696 } ) ;
9797
9898 it ( 'should handle dropSpecialCharacters in textarea' , ( ) => {
@@ -119,7 +119,6 @@ describe('Directive: Mask with Textarea', () => {
119119 component . mask . set ( '0000.0000' ) ;
120120 equalTextarea ( '1234567' , '1234.567' , fixture ) ;
121121
122- // Change mask dynamically
123122 component . mask . set ( '00/00/0000' ) ;
124123 equalTextarea ( '12345678' , '12/34/5678' , fixture ) ;
125124 } ) ;
@@ -144,44 +143,28 @@ describe('Directive: Mask with Textarea', () => {
144143 } ) ;
145144
146145 it ( 'should handle textarea with no mask' , ( ) => {
147- // No mask set
148146 equalTextarea ( 'any text' , 'any text' , fixture ) ;
149147 equalTextarea ( '123456' , '123456' , fixture ) ;
150148151149 } ) ;
152150
153- it ( 'should handle textarea with large content' , ( ) => {
154- component . mask . set ( 'A*' ) ;
155- const largeText =
156- 'This is a very long text that should be handled properly by the textarea with mask. ' . repeat (
157- 10
158- ) ;
159- const expectedText = largeText . replace ( / \s / g, '' ) ; // Remove spaces for A* mask
160- equalTextarea ( largeText , expectedText , fixture ) ;
161- } ) ;
162-
163151 it ( 'should handle textarea with special characters in content' , ( ) => {
164152 component . mask . set ( 'A*' ) ;
165153 const textWithSpecialChars = 'Text with special chars: !@#$%^&*()_+-=[]{}|;:,.<>?' ;
166- const expectedText = textWithSpecialChars . replace ( / [ ^ a - z A - Z ] / g, '' ) ; // Keep only letters for A* mask
154+ const expectedText = textWithSpecialChars . replace ( / [ ^ a - z A - Z ] / g, '' ) ;
167155 equalTextarea ( textWithSpecialChars , expectedText , fixture ) ;
168156 } ) ;
169157
170158 it ( 'should handle textarea with arrow up key (should not be prevented)' , ( ) => {
171159 component . mask . set ( '0000-0000' ) ;
172160 const textarea = fixture . debugElement . query ( By . css ( '#masked' ) ) . nativeElement ;
173161
174- // Set some content and focus
175162 textarea . value = '1234-5678' ;
176163 textarea . focus ( ) ;
177164 textarea . setSelectionRange ( 5 , 5 ) ;
178165
179- // Test arrow up (should work in textarea for line navigation)
180166 const arrowUpEvent = new KeyboardEvent ( 'keydown' , { key : 'ArrowUp' } ) ;
181167 textarea . dispatchEvent ( arrowUpEvent ) ;
182-
183- // Arrow up should not be prevented in textarea (this is the key test)
184- // The event should not have defaultPrevented set to true
185168 } ) ;
186169
187170 it ( 'should handle textarea with backspace key' , ( ) => {
@@ -194,8 +177,6 @@ describe('Directive: Mask with Textarea', () => {
194177
195178 const backspaceEvent = new KeyboardEvent ( 'keydown' , { key : 'Backspace' } ) ;
196179 textarea . dispatchEvent ( backspaceEvent ) ;
197-
198- // Backspace should work normally in textarea
199180 } ) ;
200181
201182 it ( 'should handle textarea with paste event' , ( ) => {
@@ -204,12 +185,9 @@ describe('Directive: Mask with Textarea', () => {
204185
205186 textarea . focus ( ) ;
206187
207- // Simulate paste event
208188 const pasteEvent = new ClipboardEvent ( 'paste' , {
209189 clipboardData : new DataTransfer ( ) ,
210190 } ) ;
211191 textarea . dispatchEvent ( pasteEvent ) ;
212-
213- // Paste should be handled
214192 } ) ;
215193} ) ;
0 commit comments