mirror of
https://github.com/tenrok/maska.git
synced 2026-06-20 20:00:34 +03:00
feat: simple mode for mask directive
Allow string passing to set a mask without data-maska attribute
This commit is contained in:
@@ -20,6 +20,12 @@ const prepareInput = async (markup: string) => {
|
||||
}
|
||||
|
||||
describe('init', () => {
|
||||
test('with string', async () => {
|
||||
input = await prepareInput(`<input x-maska="'#-#'" value="123">`)
|
||||
|
||||
expect(input).toHaveValue('1-2')
|
||||
})
|
||||
|
||||
test('with data attr', async () => {
|
||||
input = await prepareInput(`<input x-maska data-maska="#-#" value="123">`)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user