Skip to content

Commit 3cdcc43

Browse files
test: add more tests for negative numbers in separator feature
1 parent 7f53ac8 commit 3cdcc43

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

projects/ngx-mask-lib/src/test/separator.spec.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,18 @@ describe('Separator: Mask', () => {
135135
equal('1000000', '1.000.000', fixture);
136136
});
137137

138+
it('should not accept more than one minus signal at the beginning of input for separator thousandSeparator . for --1000', () => {
139+
component.mask = 'separator';
140+
component.thousandSeparator = '.';
141+
equal('--1000', '-1.000', fixture);
142+
});
143+
144+
it('should not accept more than one minus signal for separator thousandSeparator . for -100-0000', () => {
145+
component.mask = 'separator';
146+
component.thousandSeparator = '.';
147+
equal('-100-0000', '-1.000.000', fixture);
148+
});
149+
138150
it('should limit separator thousandSeparator . to 100000', () => {
139151
component.mask = 'separator';
140152
component.thousandSeparator = '.';

0 commit comments

Comments
 (0)