From 7709d3d78648a0e97dc050dd34a92aa1f5371874 Mon Sep 17 00:00:00 2001 From: Jenish Date: Sun, 12 Oct 2025 05:20:21 +0530 Subject: [PATCH] fix(curriculum): add .trim() to business card lab tests (#62732) --- .../6690e10ebe2181212abc9652.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/curriculum/challenges/english/blocks/lab-business-card/6690e10ebe2181212abc9652.md b/curriculum/challenges/english/blocks/lab-business-card/6690e10ebe2181212abc9652.md index 03e07170158..72b4170b810 100644 --- a/curriculum/challenges/english/blocks/lab-business-card/6690e10ebe2181212abc9652.md +++ b/curriculum/challenges/english/blocks/lab-business-card/6690e10ebe2181212abc9652.md @@ -180,19 +180,19 @@ assert.exists(document.querySelector('div.business-card p.company')); The first `p` element, the one with class of `full-name`, should contain your name. ```js -assert.isAbove(document.querySelector(".full-name")?.innerText.length, 0); +assert.isNotEmpty(document.querySelector(".full-name")?.innerText.trim()); ``` The second `p` element, the one with a `class` attribute of `designation`, should contain your designation. ```js -assert.isAbove(document.querySelector(".designation")?.innerText.length, 0); +assert.isNotEmpty(document.querySelector(".designation")?.innerText.trim()); ``` The third `p` element, the one with the `class` attribute with a value of`company`, should contain your company name. ```js -assert.isAbove(document.querySelector(".company")?.innerText.length, 0); +assert.isNotEmpty(document.querySelector(".company")?.innerText.trim()); ``` After the third `p` element, the one with the `class` attribute with a value of `company`, there should be an `hr` element. @@ -204,7 +204,7 @@ assert.exists(document.querySelector('p.company + hr')); After the first `hr` element, there should be a `p` element with an email address as your text. ```js -assert.isAbove(document.querySelectorAll('.business-card hr + p')[0].innerText.length, 0); +assert.isNotEmpty(document.querySelectorAll('.business-card hr + p')[0].innerText.trim()); ``` After the email `p` element, there should be another `p` element with a phone number as your text. @@ -246,7 +246,7 @@ assert.exists(document.querySelector('div.business-card div.social-media')); Inside the `.social-media` element, there should be an `h2` element with the text `Connect with me`. ```js -assert.equal(document.querySelector('.social-media h2')?.textContent, 'Connect with me'); +assert.equal(document.querySelector('.social-media h2')?.textContent.trim(), 'Connect with me'); ``` Inside the `.social-media` element there should be three `a` elements. @@ -258,7 +258,7 @@ assert.lengthOf(document.querySelectorAll('.social-media a'), 3); The first `a` element should have the text `Twitter`. ```js -assert.equal(document.querySelectorAll(".social-media a")[0]?.textContent, 'Twitter'); +assert.equal(document.querySelectorAll(".social-media a")[0]?.textContent.trim(), 'Twitter'); ``` The `href` of the first `a` element should point to a valid link. @@ -271,7 +271,7 @@ The second `a` element should have the text `LinkedIn`. ```js -assert.equal(document.querySelectorAll(".social-media a")[1]?.textContent, 'LinkedIn'); +assert.equal(document.querySelectorAll(".social-media a")[1]?.textContent.trim(), 'LinkedIn'); ``` The `href` of the second `a` element should point to a valid link. @@ -283,7 +283,7 @@ assert.isAbove(document.querySelectorAll('.social-media a')[1]?.getAttribute('hr The third `a` element should have the text `GitHub`. ```js -assert.equal(document.querySelectorAll(".social-media a")[2]?.textContent, 'GitHub'); +assert.equal(document.querySelectorAll(".social-media a")[2]?.textContent.trim(), 'GitHub'); ``` The `href` of the third `a` element should point to a valid link.