Skip to content

Commit b80e4cb

Browse files
committed
Corrected the tests of ex 03 so they don't break
1 parent 0c966b0 commit b80e4cb

File tree

7 files changed

+38
-14
lines changed

7 files changed

+38
-14
lines changed

exercises/01.3-Your-Second-Style/tests.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ describe("All the styles should be applied", function() {
2626
// console.log(bodyInlineStyle[0].style._values.background);
2727
});
2828
it("You should not change the existing head tag elements", function () {
29-
let meta = document.querySelector('head').querySelector("meta")
29+
let meta = document.querySelector('head').querySelector("meta");
3030

31-
expect(meta).toBe(null)
31+
expect(meta).toBe(null);
3232
})
3333
});

exercises/02.1-Background/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4+
<meta charset="UTF-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
47
<link rel="stylesheet" type="text/css" href="./styles.css" />
58
<title>02 Background</title>
69
</head>

exercises/02.1-Background/tests.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,13 @@ describe("All the styles should be applied", function () {
1515

1616

1717
});
18+
1819
afterEach(() => {
1920
jest.resetModules();
2021
});
21-
it("The body tag should not contains any inline style", function () {
22+
23+
24+
it("The body tag should not contain any inline style", function () {
2225
document.querySelector(
2326
"head"
2427
).innerHTML=`<style>${css.toString()}</style>`;

exercises/03-List-styling/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ Will remove the numbers or bullets and will move the text to the left so there i
2222

2323
**Note:**
2424

25+
Build the existing code first to see what the page originally looks like.
26+
Then make the changes below and build again.
2527

2628
## 📝 Instructions:
2729

exercises/03-List-styling/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4+
<meta charset="UTF-8" />
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
47
<link rel="stylesheet" type="text/css" href="./styles.css" />
58
<title>03 List styling</title>
69
</head>

exercises/03-List-styling/styles.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ body {
1212
padding: 120px;
1313
width: 300px;
1414
}
15+

exercises/03-List-styling/tests.js

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,39 @@ const html=fs.readFileSync(path.resolve(__dirname, "./index.html"), "utf8");
44

55
jest.dontMock("fs");
66

7-
describe("The Table tag should contain inline style background: green", function() {
7+
describe("The lists should be modified accordingly", function() {
88
beforeEach(() => {
99
//here I import the HTML into the document
1010
document.documentElement.innerHTML = html.toString();
1111
});
1212
afterEach(() => {
1313
jest.resetModules();
1414
});
15+
1516
it("You should not change the existing head tag elements", function () {
1617
let head = document.querySelector('head');
17-
let meta = head.querySelector("meta")
18-
let title = head.querySelector('title').innerHTML
18+
let title = head.querySelector('title').innerHTML;
1919

20-
expect(meta).toBe(null)
21-
expect(title).toBe('03 Inline Styles')
20+
expect(title).toBe('03 List styling')
2221
})
2322

24-
it("The background should be green", function() {
25-
const table = document.querySelector("table");
26-
// expect(table.style.background === "green").toBeTruthy();
27-
var styles = window.getComputedStyle(table);
28-
expect(styles["background"]).toBe("green");
29-
});
23+
// Test in progress:
24+
// it("The lists should be correctly styled", function() {
25+
// const uls = document.querySelectorAll("ul");
26+
// const ols = document.querySelectorAll("ol");
27+
// console.log(uls);
28+
// console.log(ols);
29+
30+
// var style1 = window.getComputedStyle(ols[0]);
31+
// var style2 = window.getComputedStyle(uls[0]);
32+
// var style3 = window.getComputedStyle(ols[1]);
33+
// var style4 = window.getComputedStyle(uls[1]);
34+
35+
36+
// expect(style1["listStyleType"]).toBe("lower-alpha");
37+
// expect(style2["listStyleType"]).toBe("square");
38+
// expect(style3["listStyleType"]).toBe("armenian");
39+
// expect(style4["listStyleType"]).toBe("none");
40+
41+
// });
3042
});

0 commit comments

Comments
 (0)