mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-06-22 21:08:12 +08:00
fix(curriculum): add .trim() to textContent for workshop-final-exams-table (#62609)
This commit is contained in:
parent
b707f80d63
commit
fa80f066ad
@ -40,19 +40,19 @@ assert.isNotNull(document.querySelector('tbody tr'));
|
||||
You should have a `td` element with the text `Davis` inside the `tr` element.
|
||||
|
||||
```js
|
||||
assert.strictEqual(document.querySelector('tbody tr td')?.textContent, 'Davis');
|
||||
assert.strictEqual(document.querySelector('tbody tr td')?.textContent.trim(), 'Davis');
|
||||
```
|
||||
|
||||
You should have a `td` element with the text `Alex` inside the `tr` element.
|
||||
|
||||
```js
|
||||
assert.strictEqual(document.querySelectorAll('tbody tr td')[1]?.textContent, 'Alex');
|
||||
assert.strictEqual(document.querySelectorAll('tbody tr td')[1]?.textContent.trim(), 'Alex');
|
||||
```
|
||||
|
||||
You should have a `td` element with the text `54` inside the `tr` element.
|
||||
|
||||
```js
|
||||
assert.strictEqual(document.querySelectorAll('tbody tr td')[2]?.textContent, '54');
|
||||
assert.strictEqual(document.querySelectorAll('tbody tr td')[2]?.textContent.trim(), '54');
|
||||
```
|
||||
|
||||
You should have all three of the `td` elements inside the `tr` element.
|
||||
|
||||
@ -32,19 +32,19 @@ assert.isNotNull(document.querySelector('tbody tr:nth-of-type(2)'));
|
||||
You should have a `td` element with the text `Doe` inside the second `tr` element.
|
||||
|
||||
```js
|
||||
assert.strictEqual(document.querySelector('tbody tr:nth-of-type(2) td:first-child')?.textContent, 'Doe');
|
||||
assert.strictEqual(document.querySelector('tbody tr:nth-of-type(2) td:first-child')?.textContent.trim(), 'Doe');
|
||||
```
|
||||
|
||||
You should have a `td` element with the text `Samantha` inside the second `tr` element.
|
||||
|
||||
```js
|
||||
assert.strictEqual(document.querySelector('tbody tr:nth-of-type(2) td:nth-child(2)')?.textContent, 'Samantha');
|
||||
assert.strictEqual(document.querySelector('tbody tr:nth-of-type(2) td:nth-child(2)')?.textContent.trim(), 'Samantha');
|
||||
```
|
||||
|
||||
You should have a `td` element with the text `92` inside the second `tr` element.
|
||||
|
||||
```js
|
||||
assert.strictEqual(document.querySelector('tbody tr:nth-of-type(2) td:last-child')?.textContent, '92');
|
||||
assert.strictEqual(document.querySelector('tbody tr:nth-of-type(2) td:last-child')?.textContent.trim(), '92');
|
||||
```
|
||||
|
||||
You should have a third `tr` inside your `tbody` element.
|
||||
@ -56,19 +56,19 @@ assert.strictEqual(document.querySelectorAll('tbody tr').length, 3);
|
||||
You should have a `td` element with the text `Rodriguez` inside the third `tr` element.
|
||||
|
||||
```js
|
||||
assert.strictEqual(document.querySelector('tbody tr:nth-of-type(3) td:first-child')?.textContent, 'Rodriguez');
|
||||
assert.strictEqual(document.querySelector('tbody tr:nth-of-type(3) td:first-child')?.textContent.trim(), 'Rodriguez');
|
||||
```
|
||||
|
||||
You should have a `td` element with the text `Marcus` inside the third `tr` element.
|
||||
|
||||
```js
|
||||
assert.strictEqual(document.querySelector('tbody tr:nth-of-type(3) td:nth-child(2)')?.textContent, 'Marcus');
|
||||
assert.strictEqual(document.querySelector('tbody tr:nth-of-type(3) td:nth-child(2)')?.textContent.trim(), 'Marcus');
|
||||
```
|
||||
|
||||
You should have a `td` element with the text `88` inside the third `tr` element.
|
||||
|
||||
```js
|
||||
assert.strictEqual(document.querySelector('tbody tr:nth-of-type(3) td:last-child')?.textContent, '88');
|
||||
assert.strictEqual(document.querySelector('tbody tr:nth-of-type(3) td:last-child')?.textContent.trim(), '88');
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
@ -32,19 +32,19 @@ assert.isNotNull(document.querySelector('tbody tr:nth-of-type(4)'));
|
||||
You should have a `td` element with the text `Thompson` inside the fourth `tr` element.
|
||||
|
||||
```js
|
||||
assert.strictEqual(document.querySelector('tbody tr:nth-of-type(4) td:first-child')?.textContent, 'Thompson');
|
||||
assert.strictEqual(document.querySelector('tbody tr:nth-of-type(4) td:first-child')?.textContent.trim(), 'Thompson');
|
||||
```
|
||||
|
||||
You should have a `td` element with the text `Jane` inside the fourth `tr` element.
|
||||
|
||||
```js
|
||||
assert.strictEqual(document.querySelector('tbody tr:nth-of-type(4) td:nth-of-type(2)')?.textContent, 'Jane');
|
||||
assert.strictEqual(document.querySelector('tbody tr:nth-of-type(4) td:nth-of-type(2)')?.textContent.trim(), 'Jane');
|
||||
```
|
||||
|
||||
You should have a `td` element with the text `77` inside the fourth `tr` element.
|
||||
|
||||
```js
|
||||
assert.strictEqual(document.querySelector('tbody tr:nth-of-type(4) td:nth-of-type(3)')?.textContent, '77');
|
||||
assert.strictEqual(document.querySelector('tbody tr:nth-of-type(4) td:nth-of-type(3)')?.textContent.trim(), '77');
|
||||
```
|
||||
|
||||
You should have a fifth `tr` inside your `tbody` element.
|
||||
@ -56,19 +56,19 @@ assert.strictEqual(document.querySelectorAll('tbody tr').length, 5);
|
||||
You should have a `td` element with the text `Williams` inside the fifth `tr` element.
|
||||
|
||||
```js
|
||||
assert.strictEqual(document.querySelector('tbody tr:nth-of-type(5) td:first-child')?.textContent, 'Williams');
|
||||
assert.strictEqual(document.querySelector('tbody tr:nth-of-type(5) td:first-child')?.textContent.trim(), 'Williams');
|
||||
```
|
||||
|
||||
You should have a `td` element with the text `Natalie` inside the fifth `tr` element.
|
||||
|
||||
```js
|
||||
assert.strictEqual(document.querySelector('tbody tr:nth-of-type(5) td:nth-of-type(2)')?.textContent, 'Natalie');
|
||||
assert.strictEqual(document.querySelector('tbody tr:nth-of-type(5) td:nth-of-type(2)')?.textContent.trim(), 'Natalie');
|
||||
```
|
||||
|
||||
You should have a `td` element with the text `83` inside the fifth `tr` element.
|
||||
|
||||
```js
|
||||
assert.strictEqual(document.querySelector('tbody tr:nth-of-type(5) td:nth-of-type(3)')?.textContent, '83');
|
||||
assert.strictEqual(document.querySelector('tbody tr:nth-of-type(5) td:nth-of-type(3)')?.textContent.trim(), '83');
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
@ -40,13 +40,13 @@ assert.isNotNull(document.querySelector('tfoot tr'));
|
||||
Your first `td` element should contain the text `Average Grade`. Make sure it is inside the `tr` element.
|
||||
|
||||
```js
|
||||
assert.strictEqual(document.querySelector('tfoot tr td:first-child')?.textContent, 'Average Grade');
|
||||
assert.strictEqual(document.querySelector('tfoot tr td:first-child')?.textContent.trim(), 'Average Grade');
|
||||
```
|
||||
|
||||
Your second `td` element should contain the text `78.8`. Make sure it is inside the `tr` element.
|
||||
|
||||
```js
|
||||
assert.strictEqual(document.querySelector('tfoot tr td:nth-of-type(2)')?.textContent, '78.8');
|
||||
assert.strictEqual(document.querySelector('tfoot tr td:nth-of-type(2)')?.textContent.trim(), '78.8');
|
||||
```
|
||||
|
||||
Your `tr` element should have two `td` elements inside it.
|
||||
|
||||
@ -32,7 +32,7 @@ And with that change, your table is complete!
|
||||
You should not alter the content of the existing `td` element.
|
||||
|
||||
```js
|
||||
assert.strictEqual(document.querySelector('tfoot tr td:first-child').textContent, 'Average Grade');
|
||||
assert.strictEqual(document.querySelector('tfoot tr td:first-child').textContent.trim(), 'Average Grade');
|
||||
```
|
||||
|
||||
Your `td` element should have a `colspan` attribute.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user