From b62d1d16b5aa649fd1426e939ac5c9ca79f7705d Mon Sep 17 00:00:00 2001 From: Rajat Baranwal <126502436+rajatbaranwal@users.noreply.github.com> Date: Tue, 19 Aug 2025 22:26:38 +0530 Subject: [PATCH] fix(curriculum): trim innerText in test assertions (#61651) Co-authored-by: Huyen Nguyen <25715018+huyenltnguyen@users.noreply.github.com> --- .../workshop-blog-page/669fc938d38e6e38ace9251e.md | 2 +- .../workshop-blog-page/66a49f685961e997e337cab1.md | 2 +- .../workshop-final-exams-table/66a9b333487b9c14998539a5.md | 2 +- .../workshop-hotel-feedback-form/66a833e88d08593618f22285.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/curriculum/challenges/english/25-front-end-development/workshop-blog-page/669fc938d38e6e38ace9251e.md b/curriculum/challenges/english/25-front-end-development/workshop-blog-page/669fc938d38e6e38ace9251e.md index 54f45919cbc..320871fa7a7 100644 --- a/curriculum/challenges/english/25-front-end-development/workshop-blog-page/669fc938d38e6e38ace9251e.md +++ b/curriculum/challenges/english/25-front-end-development/workshop-blog-page/669fc938d38e6e38ace9251e.md @@ -67,7 +67,7 @@ assert.match(code, /.*\s*.*<\/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"); ``` diff --git a/curriculum/challenges/english/25-front-end-development/workshop-blog-page/66a49f685961e997e337cab1.md b/curriculum/challenges/english/25-front-end-development/workshop-blog-page/66a49f685961e997e337cab1.md index bce6d463106..e941237074d 100644 --- a/curriculum/challenges/english/25-front-end-development/workshop-blog-page/66a49f685961e997e337cab1.md +++ b/curriculum/challenges/english/25-front-end-development/workshop-blog-page/66a49f685961e997e337cab1.md @@ -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!"); ``` diff --git a/curriculum/challenges/english/25-front-end-development/workshop-final-exams-table/66a9b333487b9c14998539a5.md b/curriculum/challenges/english/25-front-end-development/workshop-final-exams-table/66a9b333487b9c14998539a5.md index d959bf2f86c..add14acba5d 100644 --- a/curriculum/challenges/english/25-front-end-development/workshop-final-exams-table/66a9b333487b9c14998539a5.md +++ b/curriculum/challenges/english/25-front-end-development/workshop-final-exams-table/66a9b333487b9c14998539a5.md @@ -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"); ``` diff --git a/curriculum/challenges/english/25-front-end-development/workshop-hotel-feedback-form/66a833e88d08593618f22285.md b/curriculum/challenges/english/25-front-end-development/workshop-hotel-feedback-form/66a833e88d08593618f22285.md index f0ceebfb68a..1c2d643de29 100644 --- a/curriculum/challenges/english/25-front-end-development/workshop-hotel-feedback-form/66a833e88d08593618f22285.md +++ b/curriculum/challenges/english/25-front-end-development/workshop-hotel-feedback-form/66a833e88d08593618f22285.md @@ -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"); ```