2
0
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:
Alexander Shabunevich
2024-06-12 17:52:55 +03:00
parent cb87ea76c0
commit 488a52f760
16 changed files with 150 additions and 102 deletions
+6
View File
@@ -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">`)