From da28bd22ecca5a3f9d4e01b7ae10586dfd643eaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charly=20Chac=C3=B3n?= <107764250+Charlytoc@users.noreply.github.com> Date: Sun, 7 Apr 2024 10:22:21 -0500 Subject: [PATCH 1/6] Update devcontainer.json --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 966902c0..60c472bf 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -22,7 +22,7 @@ // Use 'forwardPorts' to make a list of ports inside the container available locally. // "forwardPorts": [], - "onCreateCommand": "npm i jest@24.8.0 -g && npm i @learnpack/learnpack@2.1.39 -g && learnpack plugins:install @learnpack/node@1.1.5 && learnpack plugins:install @learnpack/html@1.1.2" + "onCreateCommand": "npm i jest@29.7.0 -g && npm i @learnpack/learnpack@2.1.44 -g && learnpack plugins:install @learnpack/node@1.1.11 && learnpack plugins:install @learnpack/html@1.1.5" // Use 'postCreateCommand' to run commands after the container is created. // "postCreateCommand": "yarn install", From 61ca50c77c0a13f6c8ca79a3c39d90ba84da0df3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charly=20Chac=C3=B3n?= <107764250+Charlytoc@users.noreply.github.com> Date: Sun, 7 Apr 2024 15:52:56 +0000 Subject: [PATCH 2/6] Fixed all tests --- .devcontainer/devcontainer.json | 2 +- .learn/exercises/11-postcard-divisions/test.js | 2 ++ .learn/exercises/11.1-header-content/test.js | 3 +++ .learn/exercises/12-split-postcard-body/test.js | 1 + .learn/exercises/12.1-body-content/test.js | 1 + .learn/utils/dom.js | 3 ++- 6 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 60c472bf..eaa7756d 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -22,7 +22,7 @@ // Use 'forwardPorts' to make a list of ports inside the container available locally. // "forwardPorts": [], - "onCreateCommand": "npm i jest@29.7.0 -g && npm i @learnpack/learnpack@2.1.44 -g && learnpack plugins:install @learnpack/node@1.1.11 && learnpack plugins:install @learnpack/html@1.1.5" + "onCreateCommand": "npm i jest@29.7.0 jest-environment-jsdom@29.7.0 -g && npm i @learnpack/learnpack@2.1.45 -g && learnpack plugins:install @learnpack/node@1.1.11 && learnpack plugins:install @learnpack/html@1.1.7" // Use 'postCreateCommand' to run commands after the container is created. // "postCreateCommand": "yarn install", diff --git a/.learn/exercises/11-postcard-divisions/test.js b/.learn/exercises/11-postcard-divisions/test.js index e1c8c42d..42f03fe9 100644 --- a/.learn/exercises/11-postcard-divisions/test.js +++ b/.learn/exercises/11-postcard-divisions/test.js @@ -26,11 +26,13 @@ test("Create a div with class postcard-header as child of .postcard", function() }) test("Create a div with class postcard-body as child of .postcard", function(){ + dom = fromFile(); const e=dom.querySelector('.postcard').inside().querySelector('.postcard-body') expect(e).toBeTruthy(); }) test("Create a div with class postcard-footer as child of .postcard", function(){ + dom = fromFile(); const e=dom.querySelector('.postcard').inside().querySelector('.postcard-footer') expect(e).toBeTruthy(); }) diff --git a/.learn/exercises/11.1-header-content/test.js b/.learn/exercises/11.1-header-content/test.js index 4ab84f27..0886515f 100644 --- a/.learn/exercises/11.1-header-content/test.js +++ b/.learn/exercises/11.1-header-content/test.js @@ -26,16 +26,19 @@ test("Create an image inside the .postcard-header
", function(){ }) test("Create an

inside the .postcard-header
", function(){ + dom = fromFile(); const e=dom.querySelector('.postcard-header').inside().querySelector('h1') expect(e).toBeTruthy(); }) test("The

inside .postcard-header should say 'My Postcard'", function(){ + dom = fromFile(); const e =dom.querySelector('.postcard-header').inside().querySelector('h1') expect(e.innerHTML.toLowerCase()).toEqual("My Postcard".toLowerCase()); }) test("The tag should contain the given URL as src, E.g: ", function(){ + dom = fromFile(); const e =dom.querySelector('.postcard-header').inside().querySelector('img') expect(e.src).toEqual('https://raw.githubusercontent.com/breatheco-de/exercise-postcard/e63a7916530cc850bd92aa1c2e19191837fb5c80/.learn/assets/4geeks.png'); }) diff --git a/.learn/exercises/12-split-postcard-body/test.js b/.learn/exercises/12-split-postcard-body/test.js index 00306410..e09f653f 100644 --- a/.learn/exercises/12-split-postcard-body/test.js +++ b/.learn/exercises/12-split-postcard-body/test.js @@ -26,6 +26,7 @@ test("Create a
inside the .postcard-body and add the class .body-left to i }) test("Create another
inside the .postcard-body and add the class .body-right to it", function(){ + dom = fromFile(); const e=dom.querySelector('.postcard-body').inside().querySelector('div.body-right') expect(e).toBeTruthy(); }) diff --git a/.learn/exercises/12.1-body-content/test.js b/.learn/exercises/12.1-body-content/test.js index 2d9d11cd..7e1ab0e8 100644 --- a/.learn/exercises/12.1-body-content/test.js +++ b/.learn/exercises/12.1-body-content/test.js @@ -26,6 +26,7 @@ test("Create a
inside the .postcard-body and add the class .body-left to i }) test("Create a
inside the .postcard-body and add the class .body-right to it", function(){ + dom = fromFile(); const e=dom.querySelector('.postcard-body').inside().querySelector('div.body-right') expect(e).toBeTruthy(); }) diff --git a/.learn/utils/dom.js b/.learn/utils/dom.js index b3a794c8..322b13e5 100644 --- a/.learn/utils/dom.js +++ b/.learn/utils/dom.js @@ -14,7 +14,8 @@ const DOM = (path=null, html=null, context) => { htmlContent = fs.readFileSync(path, 'utf8') } document.documentElement.innerHTML = htmlContent.toString(); - let _document = document.cloneNode(true); + let _document = document // The current version of jest doesn't fully support the stylesheets in cloned elements + // let _document = document.cloneNode(true); return { raw: htmlContent, From ad2e6a3f6ebc4a345638f4797ca2527ca489bdf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charly=20Chac=C3=B3n?= <107764250+Charlytoc@users.noreply.github.com> Date: Sun, 7 Apr 2024 12:04:49 -0500 Subject: [PATCH 3/6] Update devcontainer.json --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index eaa7756d..16084dd5 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -22,7 +22,7 @@ // Use 'forwardPorts' to make a list of ports inside the container available locally. // "forwardPorts": [], - "onCreateCommand": "npm i jest@29.7.0 jest-environment-jsdom@29.7.0 -g && npm i @learnpack/learnpack@2.1.45 -g && learnpack plugins:install @learnpack/node@1.1.11 && learnpack plugins:install @learnpack/html@1.1.7" + "onCreateCommand": "npm i jest@29.7.0 jest-environment-jsdom@29.7.0 -g && npm i @learnpack/learnpack@2.1.46 -g && learnpack plugins:install @learnpack/node@1.1.11 && learnpack plugins:install @learnpack/html@1.1.7" // Use 'postCreateCommand' to run commands after the container is created. // "postCreateCommand": "yarn install", From 4a2907d139921956877c962a97480922b94aa5e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charly=20Chac=C3=B3n?= <107764250+Charlytoc@users.noreply.github.com> Date: Sun, 7 Apr 2024 12:05:54 -0500 Subject: [PATCH 4/6] Update .gitpod.Dockerfile --- .gitpod.Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile index 035a353f..ad164d43 100644 --- a/.gitpod.Dockerfile +++ b/.gitpod.Dockerfile @@ -2,5 +2,5 @@ FROM gitpod/workspace-full USER gitpod -RUN npm i jest@24.8.0 -g -RUN npm i @learnpack/learnpack@2.1.26 -g && learnpack plugins:install @learnpack/node@1.1.1 && learnpack plugins:install learnpack-html@0.0.20 +RUN npm i jest@29.7.0 jest-environment-jsdom@29.7.0 -g +RUN npm i @learnpack/learnpack@2.1.46 -g && learnpack plugins:install @learnpack/node@1.1.11 && learnpack plugins:install @learnpack/html@1.1.17 From 6d49af8474d32df9701fdb2e075ae8c72352bdb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charly=20Chac=C3=B3n?= <107764250+Charlytoc@users.noreply.github.com> Date: Sun, 7 Apr 2024 13:17:48 -0500 Subject: [PATCH 5/6] Update devcontainer.json --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 16084dd5..d5b1ee95 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -22,7 +22,7 @@ // Use 'forwardPorts' to make a list of ports inside the container available locally. // "forwardPorts": [], - "onCreateCommand": "npm i jest@29.7.0 jest-environment-jsdom@29.7.0 -g && npm i @learnpack/learnpack@2.1.46 -g && learnpack plugins:install @learnpack/node@1.1.11 && learnpack plugins:install @learnpack/html@1.1.7" + "onCreateCommand": "npm i jest@29.7.0 jest-environment-jsdom@29.7.0 -g && npm i @learnpack/learnpack@2.1.47 -g && learnpack plugins:install @learnpack/node@1.1.11 && learnpack plugins:install @learnpack/html@1.1.7" // Use 'postCreateCommand' to run commands after the container is created. // "postCreateCommand": "yarn install", From 11d572ca6e3debcdb63f238f9e994d3a043eda97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charly=20Chac=C3=B3n?= <107764250+Charlytoc@users.noreply.github.com> Date: Sun, 7 Apr 2024 13:18:01 -0500 Subject: [PATCH 6/6] Update .gitpod.Dockerfile --- .gitpod.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile index ad164d43..b61118a1 100644 --- a/.gitpod.Dockerfile +++ b/.gitpod.Dockerfile @@ -3,4 +3,4 @@ FROM gitpod/workspace-full USER gitpod RUN npm i jest@29.7.0 jest-environment-jsdom@29.7.0 -g -RUN npm i @learnpack/learnpack@2.1.46 -g && learnpack plugins:install @learnpack/node@1.1.11 && learnpack plugins:install @learnpack/html@1.1.17 +RUN npm i @learnpack/learnpack@2.1.47 -g && learnpack plugins:install @learnpack/node@1.1.11 && learnpack plugins:install @learnpack/html@1.1.17