import { isValidPhone, phoneMatchLength } from '../validate-phone' describe('Validate phone number', () => { test.each(['644738475', '762323764', '894736475', '936475847'])( '%s is valid phone number', (number) => { expect(isValidPhone(number)).toBe(true) }, ) test.each(['03264736', '', '6string', undefined])( '%p is invalid phone number', (number) => { expect(isValidPhone(number)).toBe(false) }, ) test('Match phone length', () => { expect(phoneMatchLength('123456789')).toBe(true) }) test.each(['12345678', '0123456789'])( '%s does not match phone length', (number) => { expect(phoneMatchLength(number)).toBe(false) }, ) })