Skip to content

Commit eae3ecf

Browse files
authored
Splitting up tests into more, smaller tasks.
1 parent c343bce commit eae3ecf

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

test/portfolio.spec.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ describe('The webpage', () => {
1919
assert.isOk(header, 'We need a `.header` element.');
2020
});
2121

22-
it('should have a non-empty title @header', () => {
22+
it('should have a non-empty title @h1', () => {
2323
const h1 = doc.querySelector('.header h1');
2424
assert.isOk(h1, 'We need an `h1` element inside `.header`.');
2525
assert.isOk(h1.textContent, 'Our header\'s `h1` element cannot be empty.');
2626
});
2727

28-
it('should have a non-empty description @header', () => {
28+
it('should have a non-empty description @h2', () => {
2929
const h2 = doc.querySelector('.header h2');
3030
assert.isOk(h2, 'We need an `h2` element inside `.header`.');
3131
assert.isOk(h2.textContent, 'Our header\'s `h2` element cannot be empty.');
@@ -42,13 +42,13 @@ describe('The webpage', () => {
4242
assert.isOk(tagline, 'We need a `.tagline` element.');
4343
});
4444

45-
it('should have a non-empty h3 tag @tagline', () => {
45+
it('should have a non-empty h3 tag @tagline-content', () => {
4646
const h3 = doc.querySelector('.tagline h3');
4747
assert.isOk(h3, 'We need an `h3` element inside `.tagline`.');
4848
assert.isOk(h3.textContent, 'Our tagline\'s `h3` element cannot be empty.');
4949
});
5050

51-
it('should have a descriptive paragraph @tagline', () => {
51+
it('should have a descriptive paragraph @tagline-content', () => {
5252
const p = doc.querySelector('.tagline p');
5353
assert.isOk(p, 'We need a `p` element inside `.tagline`.');
5454
assert.isOk(p.textContent, 'Our tagline\'s `p` element cannot be empty.');
@@ -65,29 +65,29 @@ describe('The webpage', () => {
6565
assert.isOk(skills, 'We need a `.skills` element.');
6666
});
6767

68-
it('should have a non-empty h3 tag @skills', () => {
68+
it('should have a non-empty h3 tag @skills-content', () => {
6969
const h3 = doc.querySelector('.skills h3');
7070
assert.isOk(h3, 'We need an `h3` element inside `.skills`.');
7171
assert.isOk(h3.textContent, 'Our skills\' `h3` element cannot be empty.');
7272
});
7373

74-
it('should have a descriptive paragraph @skills', () => {
74+
it('should have a descriptive paragraph @skills-content', () => {
7575
const p = doc.querySelector('.skills p');
7676
assert.isOk(p, 'We need a `p` element inside `.skills`.');
7777
assert.isOk(p.textContent, 'Our skills\' `p` element cannot be empty.');
7878
});
7979

80-
it('should have an unordered list of your skills @skills', () => {
80+
it('should have an unordered list of your skills @skills-list', () => {
8181
const ul = doc.querySelector('.skills ul');
8282
assert.isOk(ul, 'We need a `ul` element inside `.skills`.');
8383
});
8484

85-
it('should have at least 3 skills @skills', () => {
85+
it('should have at least 3 skills @skills-list', () => {
8686
const skillItems = doc.querySelectorAll('.skills ul li');
8787
assert.isAtLeast(skillItems.length, 3, 'We need at least 3 `li` elements inside the skills\' `ul`.');
8888
});
8989

90-
it('should have one skill that contains HTML @skills', () => {
90+
it('should have one skill that contains HTML @skills-list', () => {
9191
const skillItems = Array.from(doc.querySelectorAll('.skills ul li'));
9292
const htmlRegex = /html/i;
9393

@@ -109,19 +109,19 @@ describe('The webpage', () => {
109109
assert.isOk(contact, 'We need a `.contact` element.');
110110
});
111111

112-
it('should have a non-empty h3 tag @contact', () => {
112+
it('should have a non-empty h3 tag @contact-content', () => {
113113
const h3 = doc.querySelector('.contact h3');
114114
assert.isOk(h3, 'We need an `h3` element inside `.contact`.');
115115
assert.isOk(h3.textContent, 'Our contact\'s `h3` element cannot be empty.');
116116
});
117117

118-
it('should have a descriptive paragraph @contact', () => {
118+
it('should have a descriptive paragraph @contact-content', () => {
119119
const p = doc.querySelector('.contact p');
120120
assert.isOk(p, 'We need a `p` element inside `.contact`.');
121121
assert.isOk(p.textContent, 'Our contact\'s `p` element cannot be empty.');
122122
});
123123

124-
it('should have a link with an href within the paragraph @contact', () => {
124+
it('should have a link with an href within the paragraph @contact-link', () => {
125125
const a = doc.querySelector('.contact p a');
126126
assert.isOk(a, 'We need a `a` element our inside contact\'s `p` element.');
127127
assert.isOk(a.textContent, 'Our contact\'s `a` element cannot be empty.');

0 commit comments

Comments
 (0)