feat(home): seção Sobre com prova por ponto, contato por oferta e hero com a Lavação 047 na tela larga
This commit is contained in:
1 parent
d356c364e0
commit
9fd1570426
33 files changed
+1128
-369
No files matched your search
@@ -1,10 +1,12 @@
|
||||
import { render } from "@testing-library/react";
|
||||
import { SEO_IDS } from "@/lib/seo";
|
||||
import { serviceOffers, siteUrl } from "@/lib/site-content";
|
||||
import CinematicHome from "./CinematicHome";
|
||||
|
||||
/**
|
||||
* Dados estruturados da home: um único script `application/ld+json` com o negócio (ProfessionalService). O WebSite e
|
||||
* a Person já saem do layout (app/layout.tsx), e repeti-los aqui duplicaria os dados.
|
||||
* Dados estruturados da home: um único script `application/ld+json` com as três ofertas (nós Service ligados à
|
||||
* Person). O WebSite e a Person já saem do layout (app/layout.tsx), e repeti-los aqui duplicaria os dados. Sem
|
||||
* ProfessionalService nem LocalBusiness: a política de docs/seo-geo-operations.md os exclui.
|
||||
*/
|
||||
|
||||
jest.mock("../Hero", () => ({ __esModule: true, default: () => null }));
|
||||
@@ -39,15 +41,32 @@ describe("CinematicHome: dados estruturados", () => {
|
||||
expect(container.firstElementChild).toBe(scripts[0]);
|
||||
});
|
||||
|
||||
it("describes only the business as a ProfessionalService, without repeating what the layout emits", () => {
|
||||
it("describes only the three offers as Service nodes tied to the person, without repeating what the layout emits", () => {
|
||||
const [data] = structuredData();
|
||||
|
||||
expect(data["@context"]).toBe("https://schema.org");
|
||||
expect(data["@graph"]).toHaveLength(1);
|
||||
const [business] = data["@graph"];
|
||||
expect(business["@type"]).toBe("ProfessionalService");
|
||||
expect(business["@id"]).toBe(SEO_IDS.professionalService);
|
||||
expect(business.founder).toEqual({ "@id": SEO_IDS.person });
|
||||
expect(data["@graph"]).toHaveLength(3);
|
||||
for (const offer of data["@graph"]) {
|
||||
expect(offer["@type"]).toBe("Service");
|
||||
expect(offer.provider).toEqual({ "@id": SEO_IDS.person });
|
||||
expect(
|
||||
offer.areaServed.map(({ name }: { name: string }) => name),
|
||||
).toEqual(["Garuva", "Joinville", "Santa Catarina", "Brasil"]);
|
||||
}
|
||||
expect(data["@graph"].map(({ name }: { name: string }) => name)).toEqual(
|
||||
serviceOffers.map(({ name }) => name),
|
||||
);
|
||||
expect(data["@graph"].map(({ url }: { url: string }) => url)).toEqual(
|
||||
serviceOffers.map(({ href }) => `${siteUrl}${href}`),
|
||||
);
|
||||
expect(JSON.stringify(data)).not.toMatch(/"@type":"(WebSite|Person)"/);
|
||||
});
|
||||
|
||||
it("never emits ProfessionalService, LocalBusiness or an offer catalog (docs/seo-geo-operations.md)", () => {
|
||||
const [data] = structuredData();
|
||||
|
||||
expect(JSON.stringify(data)).not.toMatch(
|
||||
/ProfessionalService|LocalBusiness|OfferCatalog/,
|
||||
);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user