mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-04-14 07:00:51 -04:00
fix(curriculum): add meta test to travel agency page (#58481)
Co-authored-by: Anish Lukkireddy <anishlukkireddy@Anishs-MacBook-Pro.local>
This commit is contained in:
@@ -15,6 +15,7 @@ Fulfill the user stories below and get all the tests to pass to complete the lab
|
||||
1. You should have a `DOCTYPE` declaration.
|
||||
1. You should have an `html` element with `lang` set to `en`.
|
||||
1. You should have a `head` element containing a `meta` void element with `charset` set to `utf-8` and a `title` with the text `Travel Agency Page`.
|
||||
1. You should have a `meta` tag in your `head` element that contains a short description of your website for SEO.
|
||||
1. You should have an `h1` element to present your travel destinations.
|
||||
1. You should have a paragraph below the `h1` element introducing the travel opportunities.
|
||||
1. You should have an `h2` element with the text `Packages`.
|
||||
@@ -48,13 +49,21 @@ assert.match(
|
||||
);
|
||||
```
|
||||
|
||||
You should have a `meta` element within your `head` element.
|
||||
You should have two `meta` elements within your `head` element.
|
||||
|
||||
```js
|
||||
assert.match(code, /<\s*head\s*>[\s\S]*<\s*meta[\s\S]*>[\s\S]*<\/\s*head\s*>/i);
|
||||
assert.match(code, /<\s*head\s*>[\s\S]*(<\s*meta[\s\S]*>[\s\S]*){2,}<\/\s*head\s*>/i);
|
||||
```
|
||||
|
||||
Your `meta` element should have its `charset` attribute set to `UTF-8`.
|
||||
One `meta` element should have a `name` attribute with value of `description` and a non-empty `content` attribute.
|
||||
|
||||
```js
|
||||
assert.match(code,
|
||||
/<\s*meta\s+[^>]*name\s*=\s*["']description["'][^>]*content\s*=\s*["'][^"']+?["'][^>]*>/i,
|
||||
);
|
||||
```
|
||||
|
||||
One `meta` element should have its `charset` attribute set to `UTF-8`.
|
||||
|
||||
```js
|
||||
assert.match(code, /<\s*meta[\s\S]+?charset\s*=\s*('|")UTF-8\1/i);
|
||||
@@ -283,6 +292,7 @@ for (let anchor of anchors) {
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Travel Agency Page</title>
|
||||
<meta name="description" content="This is an example website."/>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Discover Italy</h1>
|
||||
|
||||
Reference in New Issue
Block a user