mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
fix(curriculum): trim innerText in test assertions (#61651)
Co-authored-by: Huyen Nguyen <25715018+huyenltnguyen@users.noreply.github.com>
This commit is contained in:
+1
-1
@@ -67,7 +67,7 @@ assert.match(code, /<head>.*\s*<title>.*<\/title>.*\s*<\/head>/si);
|
||||
Your `title` element should have the text `Mr. Whiskers' Blog`. You may need to check your spelling.
|
||||
|
||||
```js
|
||||
const titleText = document.querySelector('title')?.innerText
|
||||
const titleText = document.querySelector('title')?.innerText.trim();
|
||||
assert.strictEqual(titleText, "Mr. Whiskers' Blog");
|
||||
```
|
||||
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ assert.match(code, /<\/h1>/i);
|
||||
Your `h1` element should have the text of `Welcome to Mr. Whiskers' Blog Page!`. Double check for any spelling errors.
|
||||
|
||||
```js
|
||||
const h1Text = document.querySelector("h1")?.innerText
|
||||
const h1Text = document.querySelector("h1")?.innerText.trim();
|
||||
assert.strictEqual(h1Text, "Welcome to Mr. Whiskers' Blog Page!");
|
||||
```
|
||||
|
||||
|
||||
+1
-1
@@ -69,7 +69,7 @@ assert.match(code, /<head>.*\s*<title>.*<\/title>.*\s*<\/head>/si);
|
||||
Your `title` element should have the text `Calculus Final Exams Table`. You may need to check your spelling.
|
||||
|
||||
```js
|
||||
const titleText = document.querySelector('title')?.innerText
|
||||
const titleText = document.querySelector('title')?.innerText.trim();
|
||||
assert.strictEqual(titleText, "Calculus Final Exams Table");
|
||||
```
|
||||
|
||||
|
||||
+1
-1
@@ -64,7 +64,7 @@ assert.match(code, /<head>.*\s*<title>.*<\/title>.*\s*<\/head>/si);
|
||||
Your `title` element should have the text `Hotel Feedback Form`. You may need to check your spelling.
|
||||
|
||||
```js
|
||||
const titleText = document.querySelector('title')?.innerText
|
||||
const titleText = document.querySelector('title')?.innerText.trim();
|
||||
assert.strictEqual(titleText, "Hotel Feedback Form");
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user