2
0
mirror of https://github.com/tenrok/maska.git synced 2026-06-17 19:21:21 +03:00

feat: use RegExp 'u' flag by default

This commit is contained in:
Alexander Shabunevich
2025-07-02 13:00:01 +03:00
parent 13570ed875
commit 615c597897
4 changed files with 49 additions and 2 deletions
+22
View File
@@ -2162,3 +2162,25 @@ describe('Number mask', () => {
expect(input).toHaveValue('1,234')
})
})
describe('Unicode tokens mask', () => {
test('default number', async () => {
document.body.innerHTML = `<input id="input" data-maska="A" data-maska-tokens="A:[\\p{L}]:multiple">`
const input = <HTMLInputElement>document.getElementById('input')
new MaskInput(input)
await user.type(input, '1')
expect(input).toHaveValue('')
await user.type(input, 'z')
expect(input).toHaveValue('z')
await user.type(input, 'я')
expect(input).toHaveValue('zя')
await user.type(input, '1')
expect(input).toHaveValue('zя')
await user.clear(input)
})
})