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

Tests code formating

This commit is contained in:
Alexander Shabunevich
2023-01-21 12:29:27 +03:00
parent b97c7c3165
commit 8325a46f8f
+11 -8
View File
@@ -422,7 +422,10 @@ describe('test data-attr', () => {
const mask = prepareMaskWithHtml( const mask = prepareMaskWithHtml(
`<input id="input" data-maska-tokens="Z:[0-9]|X:[0-9]:optional">` `<input id="input" data-maska-tokens="Z:[0-9]|X:[0-9]:optional">`
) )
expect([...mask.items][0][1].opts.tokens).toHaveProperty('Z.optional', false) expect([...mask.items][0][1].opts.tokens).toHaveProperty(
'Z.optional',
false
)
expect([...mask.items][0][1].opts.tokens).toHaveProperty('X.optional', true) expect([...mask.items][0][1].opts.tokens).toHaveProperty('X.optional', true)
}) })
}) })
@@ -486,7 +489,7 @@ describe('#-# mask', () => {
expect(input).toHaveValue('1-') expect(input).toHaveValue('1-')
}) })
test('input 12{backspace}{backspace}', async () => { test('input 12{backspace}×2', async () => {
await user.type(input, '12{backspace}{backspace}') await user.type(input, '12{backspace}{backspace}')
expect(input).toHaveValue('1') expect(input).toHaveValue('1')
}) })
@@ -579,7 +582,7 @@ describe('#-# eager mask', () => {
expect(input).toHaveValue('1-') expect(input).toHaveValue('1-')
}) })
test('input 12{backspace}{backspace}', async () => { test('input 12{backspace}×2', async () => {
await user.type(input, '12{backspace}{backspace}') await user.type(input, '12{backspace}{backspace}')
expect(input).toHaveValue('') expect(input).toHaveValue('')
}) })
@@ -677,12 +680,12 @@ describe('#-#--# mask', () => {
expect(input).toHaveValue('1-2--') expect(input).toHaveValue('1-2--')
}) })
test('input 1234{backspace}{backspace}', async () => { test('input 1234{backspace}×2', async () => {
await user.type(input, '1234{backspace}{backspace}') await user.type(input, '1234{backspace}{backspace}')
expect(input).toHaveValue('1-2-') expect(input).toHaveValue('1-2-')
}) })
test('input 123 and {backspace}{backspace} --', async () => { test('input 123 and {backspace}×2 --', async () => {
await user.type(input, '123') await user.type(input, '123')
await user.type(input, '{backspace}{backspace}', { await user.type(input, '{backspace}{backspace}', {
initialSelectionStart: 5 initialSelectionStart: 5
@@ -726,12 +729,12 @@ describe('#-#--# eager mask', () => {
expect(input).toHaveValue('1-2--') expect(input).toHaveValue('1-2--')
}) })
test('input 1234{backspace}{backspace}', async () => { test('input 1234{backspace}×2', async () => {
await user.type(input, '1234{backspace}{backspace}') await user.type(input, '1234{backspace}{backspace}')
expect(input).toHaveValue('1-2--') expect(input).toHaveValue('1-2--')
}) })
test('input 123 and {backspace}{backspace} --', async () => { test('input 123 and {backspace}×2 --', async () => {
await user.type(input, '123') await user.type(input, '123')
await user.type(input, '{backspace}{backspace}', { await user.type(input, '{backspace}{backspace}', {
initialSelectionStart: 5 initialSelectionStart: 5
@@ -1143,7 +1146,7 @@ describe("Multiple pattern '+ +' mask", () => {
expect(input).toHaveValue('12 ') expect(input).toHaveValue('12 ')
}) })
test('input 12{ }{ }3{backspace}{backspace}', async () => { test('input 12{ }{ }3{backspace}×2', async () => {
await user.type(input, '12{ }{ }3{backspace}{backspace}') await user.type(input, '12{ }{ }3{backspace}{backspace}')
expect(input).toHaveValue('12') expect(input).toHaveValue('12')
}) })