Skip to content

Commit 5647ddb

Browse files
PR 27 fixed
1 parent 12303c9 commit 5647ddb

File tree

14 files changed

+90
-56
lines changed

14 files changed

+90
-56
lines changed

exercises/01.2-Your-First-Style/tests.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@ 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 head = document.querySelector('head')
30+
expect(head).toBeTruthy()
3031

32+
let meta = head.querySelector("meta")
3133
expect(meta).toBe(null)
3234
})
3335
});

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ 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")
30-
29+
let head = document.querySelector('head')
30+
expect(head).toBeTruthy()
31+
let meta = head.querySelector("meta")
3132
expect(meta).toBe(null)
3233
})
3334
});

exercises/02-Separate-Stylesheet/tests.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,13 @@ describe("All the styles should be applied", function () {
5252
expect(styles["background-repeat"]).toBe("inherit");
5353
});
5454
it("You should not change the existing head tag elements", function () {
55-
let meta = document.querySelector('head').querySelector("meta")
56-
let link = document.querySelector('link').href
55+
let head = document.querySelector('head')
56+
expect(head).toBeTruthy()
5757

58+
let meta = head.querySelector("meta")
5859
expect(meta).toBe(null)
60+
61+
let link = document.querySelector('link').href
5962
expect(link).toBe('http://localhost/styles.css')
6063
})
6164
});

exercises/02.1-Background/tests.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,16 @@ describe("All the styles should be applied", function () {
5252
expect(styles["background-repeat"]).toBe("inherit");
5353
});
5454
it("You should not change the existing head tag elements", function () {
55-
let head = document.querySelector('head');
56-
let meta = head.querySelector("meta")
57-
let link = head.querySelector('link').href
58-
let title = head.querySelector('title').innerHTML
55+
let head = document.querySelector('head')
56+
expect(head).toBeTruthy()
5957

58+
let meta = head.querySelector("meta")
6059
expect(meta).toBe(null)
61-
expect(link).toBe('http://localhost/styles.css')
60+
61+
const pathname = new URL(document.querySelector('link').href).pathname
62+
expect(pathname).toBe('/styles.css')
63+
64+
let title = head.querySelector('title').innerHTML
6265
expect(title).toBe('02 Background')
6366
})
6467
});

exercises/03-Inline-Styles/tests.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@ describe("The Table tag should contain inline style background: green", function
1616
});
1717

1818
it("You should not change the existing head tag elements", function () {
19-
let head = document.querySelector('head');
20-
let meta = head.querySelector("meta")
21-
let title = head.querySelector('title').innerHTML
19+
let head = document.querySelector('head')
20+
expect(head).toBeTruthy()
2221

22+
let meta = head.querySelector("meta")
2323
expect(meta).toBe(null)
24-
expect(title).toBe('03 Inline Styles')
2524

25+
let title = head.querySelector('title').innerHTML
26+
expect(title).toBe('03 Inline Styles')
2627
})
2728

2829
it("The background should be green", function() {

exercises/04.1-Combined-Rules/tests.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,16 @@ describe("All the styles should be applied", function () {
161161
expect(padLeft).toBeFalsy();
162162
});
163163
it("You should not change the existing head tag elements", function () {
164-
let head = document.querySelector('head');
165-
let meta = head.querySelector("meta")
166-
let link = head.querySelector('link').href
167-
let title = head.querySelector('title')
164+
let head = document.querySelector('head')
165+
expect(head).toBeTruthy()
168166

167+
let meta = head.querySelector("meta")
169168
expect(meta).toBe(null)
170-
expect(link).toBe('http://localhost/styles.css')
169+
170+
const pathname = new URL(document.querySelector('link').href).pathname
171+
expect(pathname).toBe('/styles.css')
172+
173+
let title = head.querySelector('title')
171174
expect(title).not.toBe(null)
172175
})
173176
});

exercises/05-Specificity/tests.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,16 @@ describe("All the styles should be applied", function () {
1717

1818

1919
it("You should not change the existing head tag elements", function () {
20-
let head = document.querySelector('head');
21-
let meta = head.querySelector("meta")
22-
let link = head.querySelector('link').href
23-
let title = head.querySelector('title')
20+
let head = document.querySelector('head')
21+
expect(head).toBeTruthy()
2422

23+
let meta = head.querySelector("meta")
2524
expect(meta).not.toBe(null)
26-
expect(link).toBe('http://localhost/styles.css')
25+
26+
const pathname = new URL(document.querySelector('link').href).pathname
27+
expect(pathname).toBe('/styles.css')
28+
29+
let title = head.querySelector('title')
2730
expect(title).not.toBe(null)
2831
})
2932
it("You should not delete or edit the existing code", function () {

exercises/06-Practicing-Rules/tests.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,16 @@ describe("All the styles should be applied", function () {
132132
expect(orangeHoverSelector).toBe('green');
133133
});
134134
it("You should not change the existing head tag elements", function () {
135-
let head = document.querySelector('head');
136-
let meta = head.querySelector("meta")
137-
let link = head.querySelector('link').href
138-
let title = head.querySelector('title')
135+
let head = document.querySelector('head')
136+
expect(head).toBeTruthy()
139137

138+
let meta = head.querySelector("meta")
140139
expect(meta).not.toBe(null)
141-
expect(link).toBe('http://localhost/styles.css')
140+
141+
const pathname = new URL(document.querySelector('link').href).pathname
142+
expect(pathname).toBe('/styles.css')
143+
144+
let title = head.querySelector('title')
142145
expect(title).not.toBe(null)
143146
})
144147

exercises/07-Very-Specific-Rules/tests.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,16 @@ describe("All the styles should be applied", function () {
7878
}
7979
)
8080
it("You should not change the existing head tag elements", function () {
81-
let head = document.querySelector('head');
82-
let meta = head.querySelector("meta")
83-
let link = head.querySelector('link').href
84-
let title = head.querySelector('title')
81+
let head = document.querySelector('head')
82+
expect(head).toBeTruthy()
8583

84+
let meta = head.querySelector("meta")
8685
expect(meta).not.toBe(null)
87-
expect(link).toBe('http://localhost/styles.css')
86+
87+
const pathname = new URL(document.querySelector('link').href).pathname
88+
expect(pathname).toBe('/styles.css')
89+
90+
let title = head.querySelector('title')
8891
expect(title).not.toBe(null)
8992
})
9093

exercises/08-Rounded-Image/tests.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,16 @@ describe("All the styles should be applied", function() {
8484
expect(idTagStyles["background-image"]).toBeTruthy();
8585
});
8686
it("You should not change the existing head tag elements", function () {
87-
let head = document.querySelector('head');
88-
let meta = head.querySelector("meta")
89-
let link = head.querySelector('link').href
90-
let title = head.querySelector('title')
87+
let head = document.querySelector('head')
88+
expect(head).toBeTruthy()
9189

90+
let meta = head.querySelector("meta")
9291
expect(meta).not.toBe(null)
93-
expect(link).toBe('http://localhost/styles.css')
92+
93+
const pathname = new URL(document.querySelector('link').href).pathname
94+
expect(pathname).toBe('/styles.css')
95+
96+
let title = head.querySelector('title')
9497
expect(title).not.toBe(null)
9598
})
9699
});

exercises/09-Anchor-Styles/tests.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,16 @@ describe("All the styles should be applied", function () {
5252
});
5353

5454
it("You should not change the existing head tag elements", function () {
55-
let head = document.querySelector('head');
56-
let meta = head.querySelector("meta")
57-
let link = head.querySelector('link').href
58-
let title = head.querySelector('title')
55+
let head = document.querySelector('head')
56+
expect(head).toBeTruthy()
5957

58+
let meta = head.querySelector("meta")
6059
expect(meta).not.toBe(null)
61-
expect(link).toBe('http://localhost/styles.css')
60+
61+
const pathname = new URL(document.querySelector('link').href).pathname
62+
expect(pathname).toBe('/styles.css')
63+
64+
let title = head.querySelector('title')
6265
expect(title).not.toBe(null)
6366
})
6467
});

exercises/12-Relative-Length-EM-REM/tests.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,16 @@ describe("All the styles should be applied", function () {
5353
}
5454
)
5555
it("You should not change the existing head tag elements", function () {
56-
let head = document.querySelector('head');
57-
let meta = head.querySelector("meta")
58-
let link = head.querySelector('link').href
59-
let title = head.querySelector('title')
56+
let head = document.querySelector('head')
57+
expect(head).toBeTruthy()
6058

59+
let meta = head.querySelector("meta")
6160
expect(meta).not.toBe(null)
62-
expect(link).toBe('http://localhost/styles.css')
61+
62+
const pathname = new URL(document.querySelector('link').href).pathname
63+
expect(pathname).toBe('/styles.css')
64+
65+
let title = head.querySelector('title')
6366
expect(title).not.toBe(null)
6467
})
6568

exercises/13-Anchor-Like-Button/tests.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,16 @@ describe("All the styles should be applied", function () {
9191
}
9292
)
9393
it("You should not change the existing head tag elements", function () {
94-
let head = document.querySelector('head');
95-
let meta = head.querySelector("meta")
96-
let link = head.querySelector('link').href
97-
let title = head.querySelector('title')
94+
let head = document.querySelector('head')
95+
expect(head).toBeTruthy()
9896

97+
let meta = head.querySelector("meta")
9998
expect(meta).not.toBe(null)
100-
expect(link).toBe('http://localhost/styles.css')
99+
100+
const pathname = new URL(document.querySelector('link').href).pathname
101+
expect(pathname).toBe('/styles.css')
102+
103+
let title = head.querySelector('title')
101104
expect(title).not.toBe(null)
102105
})
103106

learn.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
"duration": 8,
1111
"difficulty": "easy",
1212
"video-solutions": true,
13-
"graded": false,
13+
"graded": true,
1414
"config": {
15-
"disableGrading": true,
15+
"disableGrading": false,
1616
"editor": {
1717
"version": "1.0.69"
1818
}

0 commit comments

Comments
 (0)