tags exist (They should be 4)', function () {
22 | const allTR = document.querySelectorAll("tr")
23 | expect(allTR.length).toBe(4);
24 | })
25 |
26 | it('All | tags should exist with the proper innerHTML', function () {
27 | const allTH = document.querySelectorAll("th")
28 | expect(allTH.length).toBe(3)
29 | expect(allTH[0].innerHTML.toLowerCase()).toContain(`name`)
30 | expect(allTH[1].innerHTML.toLowerCase()).toContain(`last name`)
31 | expect(allTH[2].innerHTML.toLowerCase()).toContain(`phone number`)
32 | })
33 |
34 | it('All | tags should exist with the proper innerHTML', function () {
35 | const allTD = document.querySelectorAll("td")
36 | expect(allTD.length).toBe(9)
37 | for (let i = 0; i < allTD.length; i++) {
38 | expect(allTD[i].innerHTML).toBeTruthy()
39 | }
40 | })
41 |
42 |
--------------------------------------------------------------------------------
/exercises/10-replicate-html/tests.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs');
2 | const path = require('path');
3 | const html = fs.readFileSync(path.resolve(__dirname, './index.html'), 'utf8');
4 | document.documentElement.innerHTML = html.toString();
5 |
6 | jest.dontMock('fs');
7 |
8 | it('You should create an tag inside the .', function () {
9 | let body = document.querySelector("body");
10 | expect(body).toBeTruthy();
11 |
12 | let h1 = body.querySelector("h1");
13 | expect(h1).toBeTruthy();
14 | })
15 |
16 | it('You should create two tags inside the .', function () {
17 | let body = document.querySelector("body");
18 | expect(body).toBeTruthy();
19 |
20 | let h2 = body.querySelectorAll("h2");
21 | expect(h2.length).toBe(2);
22 | })
23 |
24 | it('You should create a tag inside the .', function () {
25 | let body = document.querySelector("body");
26 | expect(body).toBeTruthy();
27 |
28 | let p = body.querySelector("p");
29 | expect(p).toBeTruthy();
30 | })
31 |
32 | it('You should create an with 3 - tags inside.', function () {
33 | let body = document.querySelector("body");
34 | expect(body).toBeTruthy();
35 |
36 | let ol = body.querySelector("ol");
37 | expect(ol).toBeTruthy();
38 |
39 | let lis = ol.querySelectorAll("li");
40 | expect(lis.length).toBe(3);
41 | })
42 |
43 | it('You should create a
with 3 - tags inside.', function () {
44 | let body = document.querySelector("body");
45 | expect(body).toBeTruthy();
46 |
47 | let ul = body.querySelector("ul");
48 | expect(ul).toBeTruthy();
49 |
50 | let lis = ul.querySelectorAll("li");
51 | expect(lis.length).toBe(3);
52 | })
53 |
--------------------------------------------------------------------------------
/exercises/14-video-tag/tests.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs');
2 | const path = require('path');
3 | const html = fs.readFileSync(path.resolve(__dirname, './index.html'), 'utf8');
4 | document.documentElement.innerHTML = html.toString();
5 |
6 | jest.dontMock('fs');
7 |
8 | it('You should create a
|