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:
Anish Lukkireddy
2025-02-10 02:27:09 -05:00
committed by GitHub
parent debea874d1
commit 5a74c19bf9

View File

@@ -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>