From d1d3d36ea4e0f8787a9f3e8066ca7cbd0ec31ca6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Giftea=20=E2=98=95?= Date: Wed, 15 Oct 2025 10:33:33 +0100 Subject: [PATCH] fix(curriculum): add .trim() to innerText assertions (#62806) --- .../66a207974c806a19d6607073.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/curriculum/challenges/english/blocks/lab-book-inventory-app/66a207974c806a19d6607073.md b/curriculum/challenges/english/blocks/lab-book-inventory-app/66a207974c806a19d6607073.md index 49ec4f7d27e..7de45f9b44d 100644 --- a/curriculum/challenges/english/blocks/lab-book-inventory-app/66a207974c806a19d6607073.md +++ b/curriculum/challenges/english/blocks/lab-book-inventory-app/66a207974c806a19d6607073.md @@ -35,7 +35,7 @@ demoType: onClick You should have an `h1` element with the text `Book Inventory`. ```js -assert.equal(document.querySelector('h1')?.innerText, 'Book Inventory'); +assert.equal(document.querySelector('h1')?.innerText.trim(), 'Book Inventory'); ``` You should have only one `h1` element. @@ -59,31 +59,31 @@ assert.equal(document.querySelectorAll('th')?.length, 5); Your first column should have the text `Title` as the heading. ```js -assert.equal(document.querySelectorAll('th')[0]?.innerText, 'Title'); +assert.equal(document.querySelectorAll('th')[0]?.innerText.trim(), 'Title'); ``` Your second column should have the text `Author` as the heading. ```js -assert.equal(document.querySelectorAll('th')[1]?.innerText, 'Author'); +assert.equal(document.querySelectorAll('th')[1]?.innerText.trim(), 'Author'); ``` Your third column should have the text `Category` as the heading. ```js -assert.equal(document.querySelectorAll('th')[2]?.innerText, 'Category'); +assert.equal(document.querySelectorAll('th')[2]?.innerText.trim(), 'Category'); ``` Your fourth column should have the text `Status` as the heading. ```js -assert.equal(document.querySelectorAll('th')[3]?.innerText, 'Status'); +assert.equal(document.querySelectorAll('th')[3]?.innerText.trim(), 'Status'); ``` Your fifth column should have the text `Rate` as the heading. ```js -assert.equal(document.querySelectorAll('th')[4]?.innerText, 'Rate'); +assert.equal(document.querySelectorAll('th')[4]?.innerText.trim(), 'Rate'); ``` Your table should have at least four rows. @@ -132,7 +132,7 @@ const statusSpans = document.querySelectorAll('tr td:nth-child(4) :first-child') const rows = Array.from(document.querySelectorAll('tr')).slice(1); assert.isAbove(statusSpans.length, 0); for (let i = 0; i < rows.length; i++) { - switch (statusSpans[i]?.innerText) { + switch (statusSpans[i]?.innerText.trim()) { case 'Read': assert.isTrue(rows[i].classList.contains('read')); break;