generated from Code-Institute-Org/gitpod-full-template
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnameSpec.js
30 lines (29 loc) · 1.13 KB
/
nameSpec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
describe("validation", function() {
it("is a string with only letters", function() {
expect(nameValidation("John")).toBeTrue()
});
it("is a string with non latin letters", function() {
expect(nameValidation("Åsa")).toBeTrue()
});
it("is not valid because it is a string with only numbers", function() {
expect(nameValidation("123")).toBe(false)
});
it("is not valid because it is a string with only special characters", function() {
expect(nameValidation("@_:")).toBe(false)
});
it("is not valid because it is a string with both letters and numbers", function() {
expect(nameValidation("123John")).toBe(false)
});
it("is not valid because it is a string with both numbers and special characters", function() {
expect(nameValidation("123@{?")).toBe(false)
});
it("it is a string with only lowcase letters", function() {
expect(nameValidation("john")).toBe(true)
});
it("it is a string with only uppercase letters", function() {
expect(nameValidation("JOHN")).toBe(true)
});
it("is not valid because it is an empty string", function() {
expect(nameValidation("")).toBe(false)
});
});