11import { render } from "@testing-library/react" ;
22import { describe , it , expect } from "vitest" ;
3- import { SEO } from "./SEO " ;
3+ import { Seo } from "./Seo " ;
44
5- describe ( "SEO " , ( ) => {
5+ describe ( "Seo " , ( ) => {
66 it ( "renders title with site name" , ( ) => {
7- render ( < SEO title = "Contactos" /> ) ;
7+ render ( < Seo title = "Contactos" /> ) ;
88 expect ( document . title ) . toBe ( "Contactos | Chrisert" ) ;
99 } ) ;
1010
1111 it ( "renders default title when no title prop provided" , ( ) => {
12- render ( < SEO /> ) ;
12+ render ( < Seo /> ) ;
1313 expect ( document . title ) . toBe (
1414 "Chrisert - Especialistas em ETICS e Isolamento Térmico"
1515 ) ;
1616 } ) ;
1717
1818 it ( "renders meta description" , ( ) => {
19- render ( < SEO description = "Descrição personalizada" /> ) ;
19+ render ( < Seo description = "Descrição personalizada" /> ) ;
2020 const metaDescription = document . querySelector ( 'meta[name="description"]' ) ;
2121 expect ( metaDescription ) . toHaveAttribute ( "content" , "Descrição personalizada" ) ;
2222 } ) ;
2323
2424 it ( "renders default description when not provided" , ( ) => {
25- render ( < SEO /> ) ;
25+ render ( < Seo /> ) ;
2626 const metaDescription = document . querySelector ( 'meta[name="description"]' ) ;
2727 expect ( metaDescription ?. getAttribute ( "content" ) ) . toContain ( "ETICS" ) ;
2828 } ) ;
2929
3030 it ( "renders meta keywords" , ( ) => {
31- render ( < SEO keywords = "isolamento, capoto" /> ) ;
31+ render ( < Seo keywords = "isolamento, capoto" /> ) ;
3232 const metaKeywords = document . querySelector ( 'meta[name="keywords"]' ) ;
3333 expect ( metaKeywords ) . toHaveAttribute ( "content" , "isolamento, capoto" ) ;
3434 } ) ;
3535
3636 it ( "renders canonical URL with base URL" , ( ) => {
37- render ( < SEO canonical = "/contactos" /> ) ;
37+ render ( < Seo canonical = "/contactos" /> ) ;
3838 const canonicalLink = document . querySelector ( 'link[rel="canonical"]' ) ;
3939 expect ( canonicalLink ) . toHaveAttribute (
4040 "href" ,
@@ -43,14 +43,14 @@ describe("SEO", () => {
4343 } ) ;
4444
4545 it ( "renders default canonical URL when not provided" , ( ) => {
46- render ( < SEO /> ) ;
46+ render ( < Seo /> ) ;
4747 const canonicalLink = document . querySelector ( 'link[rel="canonical"]' ) ;
4848 expect ( canonicalLink ) . toHaveAttribute ( "href" , "https://chrisert.pt" ) ;
4949 } ) ;
5050
5151 it ( "renders Open Graph meta tags" , ( ) => {
5252 render (
53- < SEO
53+ < Seo
5454 title = "Portfolio"
5555 description = "Os nossos trabalhos"
5656 canonical = "/portfolio"
@@ -73,19 +73,19 @@ describe("SEO", () => {
7373 } ) ;
7474
7575 it ( "renders custom ogType" , ( ) => {
76- render ( < SEO ogType = "article" /> ) ;
76+ render ( < Seo ogType = "article" /> ) ;
7777 const ogType = document . querySelector ( 'meta[property="og:type"]' ) ;
7878 expect ( ogType ) . toHaveAttribute ( "content" , "article" ) ;
7979 } ) ;
8080
8181 it ( "renders custom ogImage" , ( ) => {
82- render ( < SEO ogImage = "https://example.com/image.jpg" /> ) ;
82+ render ( < Seo ogImage = "https://example.com/image.jpg" /> ) ;
8383 const ogImage = document . querySelector ( 'meta[property="og:image"]' ) ;
8484 expect ( ogImage ) . toHaveAttribute ( "content" , "https://example.com/image.jpg" ) ;
8585 } ) ;
8686
8787 it ( "renders Twitter meta tags" , ( ) => {
88- render ( < SEO title = "FAQ" description = "Perguntas frequentes" /> ) ;
88+ render ( < Seo title = "FAQ" description = "Perguntas frequentes" /> ) ;
8989
9090 const twitterCard = document . querySelector ( 'meta[name="twitter:card"]' ) ;
9191 const twitterTitle = document . querySelector ( 'meta[name="twitter:title"]' ) ;
0 commit comments