Skip to content

Commit 9984d60

Browse files
committed
Played through and fixed tests
1 parent 6354a98 commit 9984d60

2 files changed

Lines changed: 12 additions & 7 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"scripts": {
77
"start": "browser-sync start --server ./src --files ./src",
88
"test": "mocha --colors test/*.spec.js",
9-
"test:watch": "watch-run -p 'src/index.html' npm run test",
9+
"test:watch": "watch-run -p 'src/index.html,test/portfolio.spec.js' npm run test",
1010
"deploy:github-pages": "git subtree push --prefix src origin gh-pages"
1111
},
1212
"author": "Adam Fortuna <adam@codeschool.com>",

test/portfolio.spec.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ describe('The webpage', () => {
3939
const nav = doc.querySelector('.nav');
4040
assert.isOk(!nav, 'We no longer need an element with a class of `.nav`. Go ahead and remove it.');
4141
});
42+
43+
it('should still contain a ul @nav', () => {
44+
const nav = doc.querySelector('nav ul');
45+
assert.isOk(nav, 'We still need a `ul` element within our `nav`.');
46+
});
4247
});
4348

4449

@@ -48,20 +53,20 @@ describe('The webpage', () => {
4853
describe('section', () => {
4954
it('should convert the tagline @section', () => {
5055
const el = doc.querySelector('.tagline');
51-
assert.isOk(el.length > 0, 'Looks like you removed the element with a class of `.tagline`. You will still need that, but will need to change it\'s element.');
56+
assert.isOk(el, 'Looks like you removed the element with a class of `.tagline`. You will still need that, but will need to change it\'s element.');
5257
assert.equal(el.tagName.toLowerCase(), 'section', 'Make sure to change the element with a class of `tagline` to a `section` element.');
5358
});
5459

5560
it('should convert the skills @section', () => {
5661
const el = doc.querySelector('.skills');
57-
assert.isOk(el.length > 0, 'Looks like you removed the element with a class of `.skills`. You will still need that, but will need to change it\'s element.');
58-
assert.equal(skillsWithHtml.tagName.toLowerCase(), 'section', 'Make sure to change the element with a class of `skills` to a `section` element.');
62+
assert.isOk(el, 'Looks like you removed the element with a class of `.skills`. You will still need that, but will need to change it\'s element.');
63+
assert.equal(el.tagName.toLowerCase(), 'section', 'Make sure to change the element with a class of `skills` to a `section` element.');
5964
});
6065

6166
it('should convert the contact @section', () => {
6267
const el = doc.querySelector('.contact');
63-
assert.isOk(el.length > 0, 'Looks like you removed the element with a class of `.contact`. You will still need that, but will need to change it\'s element.');
64-
assert.equal(skillsWithHtml.tagName.toLowerCase(), 'section', 'Make sure to change the element with a class of `contact` to a `section` element.');
68+
assert.isOk(el, 'Looks like you removed the element with a class of `.contact`. You will still need that, but will need to change it\'s element.');
69+
assert.equal(el.tagName.toLowerCase(), 'section', 'Make sure to change the element with a class of `contact` to a `section` element.');
6570
});
6671
});
6772

@@ -76,7 +81,7 @@ describe('The webpage', () => {
7681
});
7782

7883
it('should not exist @main', () => {
79-
const sections = doc.querySelector('main section');
84+
const sections = doc.querySelectorAll('main section');
8085
assert.isOk(sections.length >= 3, 'Make sure to move all of the `section` elements into our new `main` element.');
8186
});
8287
});

0 commit comments

Comments
 (0)