mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-05 00:00:18 -04:00
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:
@@ -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--
|
||||
|
||||
@@ -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--
|
||||
|
||||
@@ -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--
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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--
|
||||
|
||||
Reference in New Issue
Block a user