Skip to content

Commit b68df77

Browse files
Merge branch 'master' into 04.3-id-Selector-to-13-Anchor-Like-Button
2 parents 90e5239 + 0da679b commit b68df77

File tree

36 files changed

+434
-289
lines changed

36 files changed

+434
-289
lines changed

.github/workflows/learnpack-audit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ jobs:
2525
uses: actions/setup-node@v2
2626
with:
2727
node-version: ${{ matrix.node-version }}
28-
- run: npm install learnpack -g
28+
- run: npm install @learnpack/learnpack@latest -g
2929
- run: learnpack audit

.gitpod.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ FROM gitpod/workspace-full:latest
44
USER gitpod
55

66
RUN npm i jest@24.8.0 -g
7-
RUN npm i @learnpack/learnpack -g && learnpack plugins:install learnpack-html@0.0.20
7+
RUN npm i @learnpack/learnpack@2.1.20 -g && learnpack plugins:install learnpack-html@0.0.20

exercises/01-Hello-World/README.es.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ Mira este ejemplo:
1919
```HTML
2020
<style>
2121
a {
22-
/* cambia este estilo a yellow */
2322
color: pink;
2423
}
2524
</style>

exercises/01-Hello-World/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ Look at this example:
1818
```HTML
1919
<style>
2020
a {
21-
/* change this style to yellow */
2221
color: pink;
2322
}
2423
</style>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!-- your code here -->
1+
<!-- your code here -->
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<!-- your code here -->
2+
<style>
3+
a {
4+
color: pink;
5+
}
6+
</style>
7+
<a href="https://google.com" target="_blank">Click me to open google.com</a>

exercises/01-Hello-World/test.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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+
const a = document.querySelector("a");
9+
10+
test("There should be an anchor tag", ()=>{
11+
expect(a).toBeTruthy()
12+
})
13+
14+
test("The anchor tag should be pink", ()=>{
15+
let styles = window.getComputedStyle(a);
16+
expect(styles["color"]).toBe("pink");
17+
});
18+
19+
test("There should be a href attribute pointing to 'https://google.com'", ()=>{
20+
let href = a.getAttribute('href');
21+
expect(href).toBeTruthy();
22+
expect(href).toBe("https://google.com");
23+
})
24+
25+
test("There should be a target attribute pointing to '_blank'", ()=>{
26+
let target = a.getAttribute('target');
27+
expect(target).toBeTruthy();
28+
expect(target).toBe("_blank");
29+
})
30+
31+
test("The anchor tag should not contains any inline style", ()=>{
32+
let emptyBodyInlineStyle = {};
33+
expect(a.style._values).toEqual(emptyBodyInlineStyle);
34+
});
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!-- add a style tag and select the p tag and make it color blue -->
2+
<style>
3+
/* the website CSS Styles go here */
4+
p {
5+
color: blue;
6+
}
7+
</style>
8+
<p>
9+
Coding is a basic literacy in the digital age, and it is important for kids to understand and be able to work with and understand the technology
10+
around them. Having children learn coding at a young age prepares them for the future. Coding helps children with communication, creativity,
11+
math,writing, and confidence.
12+
</p>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
const p = document.querySelector("p");
9+
10+
test("There should be a p tag", ()=>{
11+
expect(p).toBeTruthy();
12+
})
13+
14+
test("The p tag color should be blue", ()=>{
15+
let styles = window.getComputedStyle(p);
16+
expect(styles["color"]).toBe("blue");
17+
});
18+
19+
test("The p tag should not contain any inline style", ()=>{
20+
let emptyBodyInlineStyle = {};
21+
expect(p.style._values).toEqual(emptyBodyInlineStyle);
22+
});
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<style>
5+
a {
6+
/* change this style to blue */
7+
color: yellow;
8+
}
9+
</style>
10+
</head>
11+
<body>
12+
Hello! <a href="#">I am an anchor in red, change my color to yellow</a>
13+
</body>
14+
</html>

0 commit comments

Comments
 (0)