Skip to content

Commit 8cd39c6

Browse files
committed
Updated tests to include tagging and add error messages
1 parent ab1f82a commit 8cd39c6

File tree

2 files changed

+22
-9
lines changed

2 files changed

+22
-9
lines changed

index.html

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
<meta charset='utf-8'>
55
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
66
<meta name='viewport' content='width=device-width, initial-scale=1'>
7-
<title>Hello Code School</title>
87
</head>
98
<body>
109

test/index_test.js

+22-8
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,33 @@ describe('Your HTML Page', function() {
1717
);
1818
});
1919

20-
it('should have a different title', function() {
21-
assert.notEqual(window.$('title').text(), 'Hello Code School');
20+
it('should have a title @title', function() {
21+
assert.equal(window.$('title').length, 1, 'Make sure to create a `title` element.');
2222
});
2323

24-
it('should have a different h1', function() {
25-
assert.notEqual(window.$('h1').length, 0);
24+
it('should have a title with the text "Code School" @title', function() {
25+
assert.notEqual(window.$('title').text(), '', 'Make sure to set the content of the `title` element to your Code School username.');
2626
});
2727

28-
it('should have a ul', function() {
29-
assert.notEqual(window.$('ul').length, 0);
28+
it('should have a h1 element @h1', function() {
29+
assert.isAtLeast(window.$('h1').length, 1, "Make sure to create an `h1` element.");
3030
});
3131

32-
it('should have at least 2 li elements', function() {
33-
assert.isAtLeast(window.$('li').length, 2);
32+
it('should have content in the h1 element @h1', function() {
33+
assert.equal(window.$('h1').text(), 'Hello, Code School!', "Make sure to set the content of your `h1` element to 'Hello, Code School!'.");
34+
});
35+
36+
it('should have a ul @ul', function() {
37+
assert.isAtLeast(window.$('ul').length, 1, "Make sure to create a `ul` element.");
38+
});
39+
40+
it('should have at least 2 li elements @li', function() {
41+
assert.isAtLeast(window.$('li').length, 2, "Make sure to create at least 2 `li` elements.");
42+
});
43+
44+
it('should have content for all `li` elements. @li', function() {
45+
var message = "Make sure to include something you want to learn for each `li` element."
46+
assert.notEqual(window.$('li:first').text(), '', message);
47+
assert.notEqual(window.$('li:last').text(), '', message);
3448
});
3549
});

0 commit comments

Comments
 (0)