fix(curriculum): add .trim() to business card lab tests (#62732)

This commit is contained in:
Jenish
2025-10-12 05:20:21 +05:30
committed by GitHub
parent 7b33359746
commit 7709d3d786
@@ -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.