fix(curriculum): add .trim() to textContent for workshop-cafe-menu (#62616)

Co-authored-by: Ilenia <26656284+ilenia-magoni@users.noreply.github.com>
This commit is contained in:
Giftea ☕
2025-10-09 11:35:59 +01:00
committed by GitHub
parent fa80f066ad
commit 9c31ffdf8d
5 changed files with 5 additions and 5 deletions

View File

@@ -38,7 +38,7 @@ assert.equal(document.querySelector('p')?.previousElementSibling?.tagName, 'H1')
Your `p` element should have the text `Est. 2020`.
```js
assert.equal(document.querySelector("p").innerText, "Est. 2020");
assert.equal(document.querySelector("p")?.innerText.trim(), "Est. 2020");
```
# --seed--

View File

@@ -40,7 +40,7 @@ Your `h2` element should have the text `Coffee`.
```js
const h2 = document.querySelector('h2');
assert.equal(h2.innerText, 'Coffee');
assert.equal(h2?.innerText.trim(), 'Coffee');
```
# --seed--

View File

@@ -31,7 +31,7 @@ Your `flavor` class should be on the `p` element with the text `French Vanilla`.
```js
const el = document.querySelector(".flavor");
assert.equal(el.innerText, "French Vanilla");
assert.equal(el?.innerText.trim(), "French Vanilla");
```
# --seed--

View File

@@ -42,7 +42,7 @@ assert.lengthOf(document.querySelectorAll("footer a"), 1);
Your new `a` element should have the text `Visit our website`.
```js
assert.equal(document.querySelector("footer > address > p > a")?.innerText, "Visit our website");
assert.equal(document.querySelector("footer > address > p > a")?.innerText.trim(), "Visit our website");
```
Your new `a` element should link to `https://www.freecodecamp.org`. Remember that `a` elements use the `href` attribute to create a link.

View File

@@ -29,7 +29,7 @@ Your `price` class should be on the `p` element with the text `3.00`.
```js
const el = document.querySelector('.price');
assert.equal(el.innerText, "3.00");
assert.equal(el?.innerText.trim(), "3.00");
```
# --seed--