Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import PropTypes from "prop-types";

const SEO = ({
const Seo = ({
title,
description,
keywords,
Expand Down Expand Up @@ -51,7 +51,7 @@ const SEO = ({
);
};

SEO.propTypes = {
Seo.propTypes = {
title: PropTypes.string,
description: PropTypes.string,
keywords: PropTypes.string,
Expand All @@ -60,5 +60,5 @@ SEO.propTypes = {
ogType: PropTypes.string,
};

export { SEO };
export default SEO;
export { Seo };
export default Seo;
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
import { render } from "@testing-library/react";
import { describe, it, expect } from "vitest";
import { SEO } from "./SEO";
import { Seo } from "./Seo";

describe("SEO", () => {
describe("Seo", () => {
it("renders title with site name", () => {
render(<SEO title="Contactos" />);
render(<Seo title="Contactos" />);
expect(document.title).toBe("Contactos | Chrisert");
});

it("renders default title when no title prop provided", () => {
render(<SEO />);
render(<Seo />);
expect(document.title).toBe(
"Chrisert - Especialistas em ETICS e Isolamento Térmico"
);
});

it("renders meta description", () => {
render(<SEO description="Descrição personalizada" />);
render(<Seo description="Descrição personalizada" />);
const metaDescription = document.querySelector('meta[name="description"]');
expect(metaDescription).toHaveAttribute("content", "Descrição personalizada");
});

it("renders default description when not provided", () => {
render(<SEO />);
render(<Seo />);
const metaDescription = document.querySelector('meta[name="description"]');
expect(metaDescription?.getAttribute("content")).toContain("ETICS");
});

it("renders meta keywords", () => {
render(<SEO keywords="isolamento, capoto" />);
render(<Seo keywords="isolamento, capoto" />);
const metaKeywords = document.querySelector('meta[name="keywords"]');
expect(metaKeywords).toHaveAttribute("content", "isolamento, capoto");
});

it("renders canonical URL with base URL", () => {
render(<SEO canonical="/contactos" />);
render(<Seo canonical="/contactos" />);
const canonicalLink = document.querySelector('link[rel="canonical"]');
expect(canonicalLink).toHaveAttribute(
"href",
Expand All @@ -43,14 +43,14 @@ describe("SEO", () => {
});

it("renders default canonical URL when not provided", () => {
render(<SEO />);
render(<Seo />);
const canonicalLink = document.querySelector('link[rel="canonical"]');
expect(canonicalLink).toHaveAttribute("href", "https://chrisert.pt");
});

it("renders Open Graph meta tags", () => {
render(
<SEO
<Seo
title="Portfolio"
description="Os nossos trabalhos"
canonical="/portfolio"
Expand All @@ -73,19 +73,19 @@ describe("SEO", () => {
});

it("renders custom ogType", () => {
render(<SEO ogType="article" />);
render(<Seo ogType="article" />);
const ogType = document.querySelector('meta[property="og:type"]');
expect(ogType).toHaveAttribute("content", "article");
});

it("renders custom ogImage", () => {
render(<SEO ogImage="https://example.com/image.jpg" />);
render(<Seo ogImage="https://example.com/image.jpg" />);
const ogImage = document.querySelector('meta[property="og:image"]');
expect(ogImage).toHaveAttribute("content", "https://example.com/image.jpg");
});

it("renders Twitter meta tags", () => {
render(<SEO title="FAQ" description="Perguntas frequentes" />);
render(<Seo title="FAQ" description="Perguntas frequentes" />);

const twitterCard = document.querySelector('meta[name="twitter:card"]');
const twitterTitle = document.querySelector('meta[name="twitter:title"]');
Expand Down
4 changes: 2 additions & 2 deletions src/pages/ContactPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Button } from "@/components/ui/Button";
import { Input } from "@/components/ui/Input";
import { Textarea } from "@/components/ui/Textarea";
import ContactErrorDialog from "@/components/contact/ContactErrorDialog";
import { SEO } from "@/components/common/SEO";
import { Seo } from "@/components/common/Seo";
import {
Form,
FormControl,
Expand Down Expand Up @@ -78,7 +78,7 @@ const ContactPage = () => {

return (
<div className="container mx-auto px-4 py-10">
<SEO
<Seo
title="Contactos"
description="Entre em contacto com a Chrisert para orçamentos gratuitos de isolamento térmico e obras em fachadas."
canonical="/contactos"
Expand Down
4 changes: 2 additions & 2 deletions src/pages/FAQPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import {
AccordionItem,
AccordionTrigger,
} from "@/components/ui/accordion";
import { SEO } from "@/components/common/SEO";
import { Seo } from "@/components/common/Seo";
import { faqCategories, mythsAndFacts } from "@/data/faqData";

const FAQPage = () => {
return (
<div className="flex flex-col">
<SEO
<Seo
title="Perguntas Frequentes"
description="Dúvidas sobre ETICS ou Capoto? Encontre respostas para as perguntas mais comuns sobre isolamento térmico."
canonical="/faq"
Expand Down
4 changes: 2 additions & 2 deletions src/pages/HomePage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import { Link } from "react-router-dom";
import { Button } from "@/components/ui/Button";
import { Badge } from "@/components/ui/Badge";
import { CTASection } from "@/components/common/CTASection";
import { SEO } from "@/components/common/SEO";
import { Seo } from "@/components/common/Seo";
import { Award, Users, ThermometerSun } from "lucide-react";

const heroImage = new URL("/hero-work.jpg", import.meta.url).href;

const HomePage = () => {
return (
<div className="flex flex-col">
<SEO canonical="/" />
<Seo canonical="/" />
<section className="relative min-h-[90vh] flex items-center">
<div
className="absolute inset-0 bg-cover bg-center bg-no-repeat"
Expand Down
4 changes: 2 additions & 2 deletions src/pages/NotFoundPage.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Link } from "react-router-dom";
import { Button } from "@/components/ui/Button";
import { BarsScaleFadeIcon } from "@/components/ui/icons/BarsScaleFadeIcon";
import { SEO } from "@/components/common/SEO";
import { Seo } from "@/components/common/Seo";
import { useEffect, useState } from "react";

const NotFoundPage = () => {
Expand All @@ -23,7 +23,7 @@ const NotFoundPage = () => {

return (
<div className="min-h-[80vh] flex items-center justify-center px-4">
<SEO
<Seo
title="Página Não Encontrada"
description="A página que procura não existe."
/>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/PortfolioPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
import { CTASection } from "@/components/common/CTASection";
import Lightbox from "@/components/ui/Lightbox";
import SocialLinks from "@/components/common/SocialLinks";
import { SEO } from "@/components/common/SEO";
import { Seo } from "@/components/common/Seo";
import { portfolioImages } from "@/data/portfolioImages";

const PortfolioPage = () => {
Expand Down Expand Up @@ -46,7 +46,7 @@ const PortfolioPage = () => {

return (
<div className="flex flex-col">
<SEO
<Seo
title="Portfólio"
description="Veja alguns dos nossos projetos de isolamento térmico e renovação de fachadas realizados em Portugal."
canonical="/portfolio"
Expand Down
4 changes: 2 additions & 2 deletions src/pages/ServicesPage.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { CTASection } from "@/components/common/CTASection";
import { SEO } from "@/components/common/SEO";
import { Seo } from "@/components/common/Seo";
import { services, eticsBenefits, processSteps } from "@/data/servicesData";

const ServicesPage = () => {
return (
<div className="flex flex-col">
<SEO
<Seo
title="Serviços"
description="Conheça os nossos serviços de isolamento térmico (ETICS/Capoto), renovação de fachadas, pintura e limpeza de telhados."
canonical="/servicos"
Expand Down