Skip to content

Commit 70b3db0

Browse files
committed
test: add tests for static optional chars
1 parent e57b657 commit 70b3db0

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/formatter.test.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,17 @@ test('12.3456ac -> ##?#?.###.##?a?S', () => {
106106
})
107107
})
108108

109+
test('Optional static characters', () => {
110+
expect(formatter('C123', { mask: 'C?###' })).toMatchObject({
111+
masked: 'C123',
112+
unmasked: 'C123'
113+
})
114+
expect(formatter('123', { mask: 'C?###' })).toMatchObject({
115+
masked: '123',
116+
unmasked: '123'
117+
})
118+
})
119+
109120
test('123456 -> #*', () => {
110121
expect(formatter('123456', { mask: '#*' })).toMatchObject({
111122
masked: '123456',

0 commit comments

Comments
 (0)