forked from hngprojects/hng_boilerplate_expressjs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request hngprojects#404 from Ibrahim4Grace/feat/contact-us
fix: resolved entity id issue
- Loading branch information
Showing
2 changed files
with
3 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,87 +1,3 @@ | ||
// import { validateContact } from '../utils/contactValidator'; | ||
|
||
// describe('validateContact', () => { | ||
// it('should return no errors for valid contact data', () => { | ||
// const validData = { | ||
// name: 'Korede Akorede', | ||
// email: '[email protected]', | ||
// phoneNumber: '1234567890', | ||
// message: 'I am a backend dev', | ||
// }; | ||
|
||
// const errors = validateContact(validData); | ||
// expect(errors).toEqual([]); | ||
// }); | ||
|
||
// it('should return error for missing name', () => { | ||
// const invalidData = { | ||
// name: '', | ||
// email: '[email protected]', | ||
// phoneNumber: '1234567890', | ||
// message: 'I am a backend dev', | ||
// }; | ||
|
||
// const errors = validateContact(invalidData); | ||
// expect(errors).toContain( | ||
// 'Please enter your name. It should be less than 100 characters.' | ||
// ); | ||
// }); | ||
|
||
// it('should return error for invalid email format', () => { | ||
// const invalidData = { | ||
// name: 'Korede Akorede', | ||
// email: 'invalid-email', | ||
// phoneNumber: '1234567890', | ||
// message: 'I am a backend dev', | ||
// }; | ||
|
||
// const errors = validateContact(invalidData); | ||
// expect(errors).toContain('Please enter a valid email address.'); | ||
// }); | ||
|
||
// it('should return error for invalid phone number format', () => { | ||
// const invalidData = { | ||
// name: 'Korede Akorede', | ||
// email: '[email protected]', | ||
// phoneNumber: '123', | ||
// message: 'I am a backend dev', | ||
// }; | ||
|
||
// const errors = validateContact(invalidData); | ||
// expect(errors).toContain( | ||
// 'Please enter a valid phone number. It should be a number with 10 to 15 digits.' | ||
// ); | ||
// }); | ||
|
||
// it('should return error for message length exceeding 250 characters', () => { | ||
// const invalidData = { | ||
// name: 'Korede Akorede', | ||
// email: '[email protected]', | ||
// phoneNumber: '1234567890', | ||
// message: 'a'.repeat(251), // Message length exceeds 250 characters | ||
// }; | ||
|
||
// const errors = validateContact(invalidData); | ||
// expect(errors).toContain( | ||
// 'Please enter your message. It should be less than 250 characters.' | ||
// ); | ||
// }); | ||
|
||
// it('should return error for phone number with non-numeric characters', () => { | ||
// const invalidData = { | ||
// name: 'Korede Akorede', | ||
// email: '[email protected]', | ||
// phoneNumber: '123-456-7890', | ||
// message: 'I am a backend dev', | ||
// }; | ||
|
||
// const errors = validateContact(invalidData); | ||
// expect(errors).toContain( | ||
// 'Please enter a valid phone number. It should be a number with 10 to 15 digits.' | ||
// ); | ||
// }); | ||
// }); | ||
|
||
import { validateContact } from "../utils/contactValidator"; | ||
|
||
describe("validateContact", () => { | ||
|