Skip to content

Commit

Permalink
make separation in validators test clear again
Browse files Browse the repository at this point in the history
  • Loading branch information
dcastil committed Aug 19, 2023
1 parent 113b2c1 commit 76d5d49
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/validators.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ test('isLength', () => {
expect(isLength('screen')).toBe(true)
expect(isLength('1/2')).toBe(true)
expect(isLength('123/345')).toBe(true)

expect(isLength('[3.7%]')).toBe(false)
expect(isLength('[481px]')).toBe(false)
expect(isLength('[19.1rem]')).toBe(false)
expect(isLength('[50vw]')).toBe(false)
expect(isLength('[56vh]')).toBe(false)
expect(isLength('[length:var(--arbitrary)]')).toBe(false)

expect(isLength('1d5')).toBe(false)
expect(isLength('[1]')).toBe(false)
expect(isLength('[12px')).toBe(false)
Expand Down Expand Up @@ -60,9 +60,9 @@ test('isInteger', () => {
expect(isInteger('1')).toBe(true)
expect(isInteger('123')).toBe(true)
expect(isInteger('8312')).toBe(true)

expect(isInteger('[8312]')).toBe(false)
expect(isInteger('[2]')).toBe(false)

expect(isInteger('[8312px]')).toBe(false)
expect(isInteger('[8312%]')).toBe(false)
expect(isInteger('[8312rem]')).toBe(false)
Expand Down Expand Up @@ -178,6 +178,7 @@ test('isPercent', () => {
expect(isPercent('100.001%')).toBe(true)
expect(isPercent('.01%')).toBe(true)
expect(isPercent('0%')).toBe(true)

expect(isPercent('0')).toBe(false)
expect(isPercent('one%')).toBe(false)
})

0 comments on commit 76d5d49

Please sign in to comment.