@elastic-suite/gally-admin-shared
Version:
Shared package for gally admin BO
24 lines (22 loc) • 620 B
text/typescript
import { getFormValidityError } from './form'
describe('Form service', () => {
describe('getFormValidityError', () => {
it('Should return the error from ValidityState object', () => {
expect(
getFormValidityError({
badInput: false,
customError: false,
patternMismatch: false,
rangeOverflow: true,
rangeUnderflow: false,
stepMismatch: false,
tooLong: false,
tooShort: false,
typeMismatch: false,
valid: false,
valueMissing: false,
})
).toEqual('rangeOverflow')
})
})
})