mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-04-30 16:01:14 -04:00
fix(curriculum): update tests in event hub lab (#57822)
This commit is contained in:
@@ -92,7 +92,7 @@ const secondLink = document.querySelectorAll('header nav ul li a')[1];
|
||||
assert.exists(secondLink);
|
||||
```
|
||||
|
||||
The text of the first item in the unordered list should be `"Upcoming Events"`.
|
||||
The text of the first item in the unordered list should be `Upcoming Events`.
|
||||
|
||||
```js
|
||||
const firstLink = document.querySelectorAll('header nav>ul>li>a')[0];
|
||||
@@ -107,6 +107,13 @@ const hrefAttribute = anchorElement?.getAttribute("href");
|
||||
assert.strictEqual(hrefAttribute, "#upcoming-events");
|
||||
```
|
||||
|
||||
The text of the second item in the unordered list should be `Past Events`.
|
||||
|
||||
```js
|
||||
const secondLink = document.querySelectorAll('header nav>ul>li>a')[1];
|
||||
assert.strictEqual(secondLink.innerText, "Past Events");
|
||||
```
|
||||
|
||||
The second item in the unordered list should have the `href` set to `#past-events`.
|
||||
|
||||
```js
|
||||
@@ -230,6 +237,22 @@ for (let img of imgElements) {
|
||||
}
|
||||
```
|
||||
|
||||
Each `h3` element should have the event title.
|
||||
|
||||
```js
|
||||
const eventTitles = document.querySelectorAll('h3');
|
||||
assert.isNotEmpty(eventTitles);
|
||||
eventTitles.forEach((eventTitle => assert.isNotEmpty(eventTitle.innerText)));
|
||||
```
|
||||
|
||||
Each `p` element shoud have the event description.
|
||||
|
||||
```js
|
||||
const eventDescriptions = document.querySelectorAll('p');
|
||||
assert.isNotEmpty(eventDescriptions);
|
||||
eventDescriptions.forEach((eventDescription => assert.isNotEmpty(eventDescription.innerText)));
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
## --seed-contents--
|
||||
|
||||
Reference in New Issue
Block a user