generated from Code-Institute-Org/gitpod-full-template
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathphoneSpec.js
21 lines (20 loc) · 782 Bytes
/
phoneSpec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
describe ("Validate phone number", function() {
it ("should be a phone number", function(){
expect(phoneNumber("0720096128")).toBeTrue()
});
it ("should not be a phone number because too short", function(){
expect(phoneNumber("072")).toBe(false)
});
it ("should be a phone number", function(){
expect(phoneNumber("00460720096128")).toBeTrue()
});
it ("should not be a phone number because has other char", function(){
expect(phoneNumber("0720:096128")).toBe(false)
});
it ("should not be a phone number because has letters", function(){
expect(phoneNumber("A0720096128")).toBe(false)
});
it ("should not be a number because string is empty", function(){
expect(phoneNumber("")).toBe(false)
});
});