@@ -12,8 +12,9 @@ describe("Seo", () => {
1212 "Blog" ,
1313 "url" ,
1414 "imageUrl" ,
15- OgPageType . WebSite
16- )
15+ OgPageType . WebSite ,
16+ [ "keyword1" , "keyword2" ] ,
17+ ) ,
1718 ) . toEqual ( [
1819 {
1920 name : "viewport" ,
@@ -112,6 +113,10 @@ describe("Seo", () => {
112113 name : "yandex-verification" ,
113114 content : "741cf901cb1dbdf5" ,
114115 } ,
116+ {
117+ content : "keyword1, keyword2" ,
118+ name : "keywords" ,
119+ } ,
115120 ] ) ;
116121 } ) ;
117122
@@ -135,9 +140,10 @@ describe("Seo", () => {
135140 "Fabrizio Duroni" ,
136141 "The title" ,
137142 links ,
143+ [ "keyword1" , "keyword2" ] ,
138144 "The description" ,
139- "2021 Apr 28"
140- )
145+ "2021 Apr 28" ,
146+ ) ,
141147 ) . toContain ( `"datePublished":"2021 Apr 28"` ) ;
142148 } ) ;
143149
@@ -150,9 +156,10 @@ describe("Seo", () => {
150156 "Fabrizio Duroni" ,
151157 "The title" ,
152158 links ,
159+ [ "keyword1" , "keyword2" ] ,
153160 "The description" ,
154- "2021 Apr 28"
155- )
161+ "2021 Apr 28" ,
162+ ) ,
156163 ) . toContain ( `"dateModified":"2021 Apr 28"` ) ;
157164 } ) ;
158165
@@ -166,9 +173,10 @@ describe("Seo", () => {
166173 "Fabrizio Duroni" ,
167174 "The title" ,
168175 links ,
176+ [ "keyword1" , "keyword2" ] ,
169177 "The description" ,
170- "2021 Apr 28"
171- )
178+ "2021 Apr 28" ,
179+ ) ,
172180 ) . toContain ( `"@type":"BlogPosting"` ) ;
173181 } ) ;
174182
@@ -181,9 +189,10 @@ describe("Seo", () => {
181189 "Fabrizio Duroni" ,
182190 "The title" ,
183191 links ,
192+ [ "keyword1" , "keyword2" ] ,
184193 "The description" ,
185- "2021 Apr 28"
186- )
194+ "2021 Apr 28" ,
195+ ) ,
187196 ) . toContain ( `"@type":"WebSite"` ) ;
188197 } ) ;
189198
@@ -196,9 +205,10 @@ describe("Seo", () => {
196205 "Fabrizio Duroni" ,
197206 "The title" ,
198207 links ,
208+ [ "keyword1" , "keyword2" ] ,
199209 "The description" ,
200- "2021 Apr 28"
201- )
210+ "2021 Apr 28" ,
211+ ) ,
202212 ) . toContain ( `"@type":"Person"` ) ;
203213 } ) ;
204214 } ) ;
@@ -212,9 +222,10 @@ describe("Seo", () => {
212222 "Fabrizio Duroni" ,
213223 "The title" ,
214224 links ,
225+ [ "keyword1" , "keyword2" ] ,
215226 "The description" ,
216- "2021 Apr 28"
217- )
227+ "2021 Apr 28" ,
228+ ) ,
218229 ) . toContain ( `"url":"http://url/"` ) ;
219230 } ) ;
220231
@@ -227,9 +238,10 @@ describe("Seo", () => {
227238 "Fabrizio Duroni" ,
228239 "The title" ,
229240 links ,
241+ [ "keyword1" , "keyword2" ] ,
230242 "The description" ,
231- "2021 Apr 28"
232- )
243+ "2021 Apr 28" ,
244+ ) ,
233245 ) . toContain ( `"image":"/image.jpg"` ) ;
234246 } ) ;
235247
@@ -243,11 +255,12 @@ describe("Seo", () => {
243255 "Fabrizio Duroni" ,
244256 "The title" ,
245257 links ,
258+ [ "keyword1" , "keyword2" ] ,
246259 "The description" ,
247- "2021 Apr 28"
248- )
260+ "2021 Apr 28" ,
261+ ) ,
249262 ) . toContain (
250- `"mainEntityOfPage":{\n"@type":"WebPage",\n"@id":"http://url/"\n}`
263+ `"mainEntityOfPage":{\n"@type":"WebPage",\n"@id":"http://url/"\n}` ,
251264 ) ;
252265 } ) ;
253266
@@ -259,8 +272,9 @@ describe("Seo", () => {
259272 "Fabrizio Duroni" ,
260273 "The title" ,
261274 links ,
275+ [ "keyword1" , "keyword2" ] ,
262276 "The description" ,
263- "2021 Apr 28"
277+ "2021 Apr 28" ,
264278 ) ;
265279 expect ( jsonLD . includes ( "mainEntityOfPage" , 0 ) ) . toBeFalsy ( ) ;
266280
@@ -271,8 +285,9 @@ describe("Seo", () => {
271285 "Fabrizio Duroni" ,
272286 "The title" ,
273287 links ,
288+ [ "keyword1" , "keyword2" ] ,
274289 "The description" ,
275- "2021 Apr 28"
290+ "2021 Apr 28" ,
276291 ) ;
277292 expect ( jsonLD . includes ( "mainEntityOfPage" , 0 ) ) . toBeFalsy ( ) ;
278293 } ) ;
@@ -288,15 +303,16 @@ describe("Seo", () => {
288303 "Fabrizio Duroni" ,
289304 "The title" ,
290305 links ,
306+ [ "keyword1" , "keyword2" ] ,
291307 "The description" ,
292- "2021 Apr 28"
308+ "2021 Apr 28" ,
293309 ) . includes (
294310 `"author":{
295311 "@type":"Person",
296312 "name":"Fabrizio Duroni"
297313 }` ,
298- 0
299- )
314+ 0 ,
315+ ) ,
300316 ) . toBeFalsy ( ) ;
301317 } ) ;
302318
@@ -309,9 +325,10 @@ describe("Seo", () => {
309325 "Fabrizio Duroni" ,
310326 "The title" ,
311327 links ,
328+ [ "keyword1" , "keyword2" ] ,
312329 "The description" ,
313- "2021 Apr 28"
314- )
330+ "2021 Apr 28" ,
331+ ) ,
315332 ) . toContain ( `"author":{
316333 "@type":"Person",
317334 "name":"Fabrizio Duroni"
@@ -325,9 +342,10 @@ describe("Seo", () => {
325342 "Fabrizio Duroni" ,
326343 "The title" ,
327344 links ,
345+ [ "keyword1" , "keyword2" ] ,
328346 "The description" ,
329- "2021 Apr 28"
330- )
347+ "2021 Apr 28" ,
348+ ) ,
331349 ) . toContain ( `"author":{
332350 "@type":"Person",
333351 "name":"Fabrizio Duroni"
@@ -345,8 +363,9 @@ describe("Seo", () => {
345363 "Fabrizio Duroni" ,
346364 "The title" ,
347365 links ,
366+ [ "keyword1" , "keyword2" ] ,
348367 "The description" ,
349- "2021 Apr 28"
368+ "2021 Apr 28" ,
350369 ) . includes (
351370 `"publisher":{
352371 "@type":"Organization",
@@ -356,8 +375,8 @@ describe("Seo", () => {
356375 },
357376 "name":"Fabrizio Duroni"
358377 }` ,
359- 0
360- )
378+ 0 ,
379+ ) ,
361380 ) . toBeFalsy ( ) ;
362381 } ) ;
363382
@@ -370,9 +389,10 @@ describe("Seo", () => {
370389 "Fabrizio Duroni" ,
371390 "The title" ,
372391 links ,
392+ [ "keyword1" , "keyword2" ] ,
373393 "The description" ,
374- "2021 Apr 28"
375- )
394+ "2021 Apr 28" ,
395+ ) ,
376396 ) . toContain ( `"publisher":{
377397 "@type":"Organization",
378398 "logo":{
@@ -390,9 +410,10 @@ describe("Seo", () => {
390410 "Fabrizio Duroni" ,
391411 "The title" ,
392412 links ,
413+ [ "keyword1" , "keyword2" ] ,
393414 "The description" ,
394- "2021 Apr 28"
395- )
415+ "2021 Apr 28" ,
416+ ) ,
396417 ) . toContain ( `"publisher":{
397418 "@type":"Organization",
398419 "logo":{
@@ -414,9 +435,10 @@ describe("Seo", () => {
414435 "Fabrizio Duroni" ,
415436 "The title" ,
416437 links ,
438+ [ "keyword1" , "keyword2" ] ,
417439 "The description" ,
418- "2021 Apr 28"
419- )
440+ "2021 Apr 28" ,
441+ ) ,
420442 ) . toContain ( `"headline":"The title"` ) ;
421443 } ) ;
422444
@@ -428,8 +450,9 @@ describe("Seo", () => {
428450 "Fabrizio Duroni" ,
429451 "The title" ,
430452 links ,
453+ [ "keyword1" , "keyword2" ] ,
431454 "The description" ,
432- "2021 Apr 28"
455+ "2021 Apr 28" ,
433456 ) ;
434457 expect ( jsonLD ) . toContain ( `"headline":"Fabrizio Duroni"` ) ;
435458 } ) ;
@@ -442,8 +465,9 @@ describe("Seo", () => {
442465 "Fabrizio Duroni" ,
443466 "The title" ,
444467 links ,
468+ [ "keyword1" , "keyword2" ] ,
445469 "The description" ,
446- "2021 Apr 28"
470+ "2021 Apr 28" ,
447471 ) ;
448472 expect ( jsonLD . includes ( `"headline":"Fabrizio Duroni"` ) ) . toBeFalsy ( ) ;
449473 } ) ;
@@ -459,9 +483,10 @@ describe("Seo", () => {
459483 "Fabrizio Duroni" ,
460484 "The title" ,
461485 links ,
486+ [ "keyword1" , "keyword2" ] ,
462487 "The description" ,
463- "2021 Apr 28"
464- )
488+ "2021 Apr 28" ,
489+ ) ,
465490 ) . toContain ( `"description":"The description"` ) ;
466491 } ) ;
467492
@@ -473,8 +498,9 @@ describe("Seo", () => {
473498 "Fabrizio Duroni" ,
474499 "The title" ,
475500 links ,
501+ [ "keyword1" , "keyword2" ] ,
476502 "The description" ,
477- "2021 Apr 28"
503+ "2021 Apr 28" ,
478504 ) ;
479505 expect ( jsonLD ) . toContain ( `"description":"The title"` ) ;
480506
@@ -485,8 +511,9 @@ describe("Seo", () => {
485511 "Fabrizio Duroni" ,
486512 "The title" ,
487513 links ,
514+ [ "keyword1" , "keyword2" ] ,
488515 "The description" ,
489- "2021 Apr 28"
516+ "2021 Apr 28" ,
490517 ) ;
491518 expect ( jsonLD ) . toContain ( `"description":"The title"` ) ;
492519 } ) ;
@@ -501,9 +528,10 @@ describe("Seo", () => {
501528 "Fabrizio Duroni" ,
502529 "The title" ,
503530 links ,
531+ [ "keyword1" , "keyword2" ] ,
504532 "The description" ,
505- "2021 Apr 28"
506- )
533+ "2021 Apr 28" ,
534+ ) ,
507535 ) . toContain ( `"sameAs":[
508536 "${ links ! . twitter } ",
509537 "${ links ! . facebook } ",
@@ -521,9 +549,10 @@ describe("Seo", () => {
521549 "Fabrizio Duroni" ,
522550 "The title" ,
523551 links ,
552+ [ "keyword1" , "keyword2" ] ,
524553 "The description" ,
525- "2021 Apr 28"
526- )
554+ "2021 Apr 28" ,
555+ ) ,
527556 ) . toContain ( `"name":"Fabrizio Duroni"` ) ;
528557 } ) ;
529558
@@ -536,10 +565,27 @@ describe("Seo", () => {
536565 "Fabrizio Duroni" ,
537566 "The title" ,
538567 links ,
568+ [ "keyword1" , "keyword2" ] ,
539569 "The description" ,
540- "2021 Apr 28"
541- )
570+ "2021 Apr 28" ,
571+ ) ,
542572 ) . toContain ( `@context":"https://schema.org` ) ;
543573 } ) ;
574+
575+ it ( "keywords" , ( ) => {
576+ expect (
577+ createJsonLD (
578+ OgPageType . WebSite ,
579+ "http://url/" ,
580+ "/image.jpg" ,
581+ "Fabrizio Duroni" ,
582+ "The title" ,
583+ links ,
584+ [ "keyword1" , "keyword2" ] ,
585+ "The description" ,
586+ "2021 Apr 28" ,
587+ ) ,
588+ ) . toContain ( `keyword1,keyword2` ) ;
589+ } ) ;
544590 } ) ;
545591} ) ;
0 commit comments