mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-04-12 19:00:43 -04:00
fix(curriculum) : modified the tests in the responsive web design curriculum Step - 12 (#52100)
This commit is contained in:
committed by
GitHub
parent
436247916d
commit
9ef0f77659
@@ -36,10 +36,17 @@ assert(
|
||||
The link's text should be `cat photos`. You have either omitted the text or have a typo.
|
||||
|
||||
```js
|
||||
const nestedAnchor = document.querySelector(`p > a`);
|
||||
assert(
|
||||
nestedAnchor.innerText.toLowerCase().replace(/\s+/g, ' ') === 'cat photos'
|
||||
);
|
||||
const nestedAnchor = document.querySelector('p > a');
|
||||
const innerContent = nestedAnchor.innerHTML;
|
||||
assert.isTrue(innerContent.trim() === 'cat photos');
|
||||
```
|
||||
|
||||
The text inside your anchor element has extra leading or trailing whitespace. The only space in the anchor text should be between the word `cat` and the word `photos`.
|
||||
|
||||
```js
|
||||
const nestedAnchor = document.querySelector('p > a');
|
||||
const innerContent = nestedAnchor.innerHTML;
|
||||
assert.isNotTrue(/^\s+|\s+$/.test(innerContent));
|
||||
```
|
||||
|
||||
After nesting the anchor (`a`) element, the only `p` element content visible in the browser should be `See more cat photos in our gallery.` Double check the text, spacing, or punctuation of both the `p` and nested anchor element.
|
||||
|
||||
Reference in New Issue
Block a user