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:
@@ -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)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user