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
144 changes: 144 additions & 0 deletions src/app/__tests__/home-conversion.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
/** @vitest-environment jsdom */
import { beforeEach, describe, expect, it, vi } from "vitest";
import { fireEvent, render, screen, within } from "@testing-library/react";
import Home from "../page";
import { trackFunnelCtaClick, trackHomeCta } from "@/lib/analytics";

vi.mock("@/lib/analytics", () => ({
trackFunnelCtaClick: vi.fn(),
trackHomeCta: vi.fn(),
trackCtaWhatsAppClick: vi.fn(),
trackCtaScroll50: vi.fn(),
trackScrollDepth: vi.fn(),
trackEcosystemLinkClick: vi.fn(),
trackToolCardClick: vi.fn(),
trackCtaDemoClick: vi.fn(),
}));

const SECTION_ORDER = [
"hero-heading",
"problem-solution-heading",
"how-it-works-hub-heading",
"whatsapp-product-heading",
"faq-heading",
"final-cta-v2-heading",
"tools-heading",
"products-heading",
] as const;

const UNSUPPORTED_CLAIMS = [
"LIVE",
"Produção",
"1.247",
"74%",
"2m12s",
"70%",
"100%",
"números reais",
"não mockup",
"não é mockup",
"Ver exemplo real",
"Operações reais",
"24/7",
];

describe("home conversion cleanup", () => {
beforeEach(() => {
vi.clearAllMocks();
vi.stubEnv("NEXT_PUBLIC_WHATSAPP_NUMBER", "5511999999999");
});

it("ordena a decisão antes do ecossistema e não mostra prova inventada", () => {
render(<Home />);

const nodes = SECTION_ORDER.map((id) => {
const node = document.getElementById(id);
expect(node, id).toBeTruthy();
return node!;
});

for (let index = 1; index < nodes.length; index += 1) {
const relation = nodes[index - 1].compareDocumentPosition(nodes[index]);
expect(relation & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy();
}

const text = document.body.textContent ?? "";
for (const claim of UNSUPPORTED_CLAIMS) {
expect(text).not.toContain(claim);
}

expect(text).toContain("Dados ilustrativos");
expect(text).toContain("Demonstração da plataforma");
expect(text).toContain("Quer entender como isso funcionaria na sua operação?");
expect(screen.getByRole("heading", { name: "O que entra na operação" })).toBeTruthy();
expect(screen.getByRole("heading", { name: "Como sua operação de WhatsApp sai do improviso" })).toBeTruthy();
expect(screen.getByRole("heading", { name: "Perguntas frequentes" })).toBeTruthy();
});

it("separa CTA primário, demo e WhatsApp no hero", () => {
render(<Home />);
const hero = screen.getByRole("region", { name: /Menos mensagem perdida/i });

const primary = within(hero).getByRole("link", {
name: "Agendar diagnóstico da operação no WhatsApp",
});
expect(primary).toHaveAttribute("href", "/contato");
expect(primary.className).toContain("df-btn-primary");

const demo = within(hero).getByRole("link", {
name: "Ver demonstração guiada de atendimento no WhatsApp",
});
expect(demo).toHaveAttribute("href", "/demo");
expect(demo).toHaveTextContent("Ver demo");
expect(demo.className).not.toContain("df-btn-primary");

const whatsapp = within(hero).getByRole("link", {
name: "Falar no WhatsApp com a DevFlow Labs",
});
expect(whatsapp.getAttribute("href")).toMatch(/^https:\/\/wa\.me\/5511999999999/);
expect(whatsapp.className).not.toContain("df-btn");

fireEvent.click(primary);
expect(trackFunnelCtaClick).toHaveBeenCalledWith({
cta: "agendar_diagnostico",
surface: "hero_primary",
});
expect(trackHomeCta).toHaveBeenCalledWith("hero_agendar_diagnostico");

fireEvent.click(demo);
expect(trackFunnelCtaClick).toHaveBeenCalledWith({
cta: "ver_demo_guiada",
surface: "hero_secondary",
});
});

it("mantém o CTA final imediatamente relevante e rastreado", () => {
render(<Home />);
const finalCta = screen.getByRole("region", {
name: "Quer entender como isso funcionaria na sua operação?",
});

const primary = within(finalCta).getByRole("link", {
name: "Agendar diagnóstico da operação no WhatsApp",
});
const demo = within(finalCta).getByRole("link", {
name: "Ver demonstração guiada de atendimento no WhatsApp",
});

expect(primary).toHaveAttribute("href", "/contato");
expect(demo).toHaveAttribute("href", "/demo");
expect(demo).toHaveTextContent("Ver demo");

fireEvent.click(primary);
expect(trackFunnelCtaClick).toHaveBeenCalledWith({
cta: "agendar_diagnostico",
surface: "final_cta_primary",
});

fireEvent.click(demo);
expect(trackFunnelCtaClick).toHaveBeenCalledWith({
cta: "ver_demo_guiada",
surface: "final_cta_secondary",
});
});
});
32 changes: 6 additions & 26 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,15 @@ import { ScrollTracker } from "@/components/shared/scroll-tracker";
import { HeroV2 } from "@/components/sections/hero-v2";
import { TechnicalTrustStrip } from "@/components/sections/technical-trust-strip";
import { ProblemSolutionSection } from "@/components/sections/problem-solution-section";
import { WhatsAppProductSection } from "@/components/sections/whatsapp-product-section";
import { AuthorityRealOpsSection } from "@/components/sections/authority-real-ops-section";
import { HowItWorksHub } from "@/components/sections/how-it-works-hub";
import { ResultsSocialProofSection } from "@/components/sections/results-social-proof-section";
import { WhatsAppProductSection } from "@/components/sections/whatsapp-product-section";
import { Faq } from "@/components/sections/faq";
import { FinalCtaV2 } from "@/components/sections/final-cta-v2";

// Ecossistema secundário — abaixo da oferta principal
import { HubPillarsSection } from "@/components/sections/hub-pillars-section";
import { WhereToStartSection } from "@/components/sections/where-to-start-section";
// Ecossistema secundário — só depois da decisão de conversão
import { ToolsSection } from "@/components/sections/tools-section";
import { ProductsSection } from "@/components/sections/products-section";

// Seções existentes reaproveitadas
import { Metrics } from "@/components/sections/metrics";
import { ProofSocial } from "@/components/sections/proof-social";
import { Faq } from "@/components/sections/faq";

const baseUrl = "https://devflowlabs.com.br";
const ogImage = `${baseUrl}/og-devflow.png`;

Expand Down Expand Up @@ -91,31 +83,19 @@ export default function Home() {

<ProblemSolutionSection />

<WhatsAppProductSection />

<AuthorityRealOpsSection />

<HowItWorksHub />

<ResultsSocialProofSection />

<Metrics />

<ProofSocial />
<WhatsAppProductSection />

<Faq />

<FinalCtaV2 />

<HomeEcosystemStack>
<ToolsSection />

<ProductsSection />

<HubPillarsSection />

<WhereToStartSection />
</HomeEcosystemStack>

<FinalCtaV2 />
</>
);
}
63 changes: 0 additions & 63 deletions src/components/sections/authority-real-ops-section.tsx

This file was deleted.

5 changes: 4 additions & 1 deletion src/components/sections/faq.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const faqItems = [
{
question: "Vocês só entregam o sistema ou ajudam a implementar?",
answer:
"A entrega é consultiva: diagnóstico da operação, desenho dos fluxos, implementação guiada, treinamento e acompanhamento inicial com base nas métricas reais.",
"A entrega é consultiva: diagnóstico da operação, desenho dos fluxos, implementação guiada, treinamento e acompanhamento inicial com base no que a operação mostrar.",
},
{
question: "Para quais negócios isso faz sentido?",
Expand Down Expand Up @@ -104,7 +104,10 @@ export function Faq() {
<WhatsAppCta
label={QUICK_WHATSAPP_CTA_LABEL}
ariaLabel="Falar no WhatsApp com a DevFlow Labs"
variant="secondary"
size="default"
trackingSource="faq_whatsapp"
trackFunnel
text="Olá, tenho dúvidas sobre implementar atendimento e vendas no WhatsApp com a DevFlow."
/>
</div>
Expand Down
18 changes: 6 additions & 12 deletions src/components/sections/final-cta-v2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import Link from "next/link";
import { ArrowRight } from "lucide-react";
import { trackFunnelCtaClick } from "@/lib/analytics";
import {
HOME_DEMO_CTA_LABEL,
PRIMARY_CONVERT_CTA_LABEL,
PRIMARY_CONVERT_HREF,
PRIMARY_DEMO_CTA_LABEL,
PRIMARY_DEMO_HREF,
} from "@/lib/conversion-copy";
import { cn } from "@/lib/utils";
Expand All @@ -33,17 +33,11 @@ export function FinalCtaV2() {
id="final-cta-v2-heading"
className="df-text-primary text-2xl font-bold tracking-tight sm:text-3xl"
>
Menos mensagem perdida. Mais venda preservada.
Quer entender como isso funcionaria na sua operação?
</h2>
<p className="df-text-secondary mt-4 text-base leading-relaxed sm:text-lg">
Agende um diagnóstico para transformar atendimento e vendas no WhatsApp em rotina previsível.
</p>
<p className="df-text-secondary mt-3 text-sm leading-relaxed">
IA no repetitivo, humano no que importa — com WhatsApp Cloud API oficial, fila, handoff e dashboard.
</p>

<p className="mt-2 text-xs font-medium df-status-brand">
Operações reais em produção · implementação consultiva ponta a ponta
Em uma conversa rápida, analisamos como sua equipe usa o WhatsApp hoje e mostramos onde a DevFlow pode
organizar atendimento, distribuição e acompanhamento.
</p>

<div className="mt-6 flex flex-col items-stretch gap-3 sm:mt-8 sm:items-center sm:gap-4">
Expand All @@ -70,11 +64,11 @@ export function FinalCtaV2() {
}
className="df-btn-secondary inline-flex min-h-12 items-center justify-center gap-2 rounded-xl px-6 text-sm font-semibold transition-colors"
>
{PRIMARY_DEMO_CTA_LABEL}
{HOME_DEMO_CTA_LABEL}
</Link>
</div>
<p className="df-text-muted mt-6 text-xs leading-relaxed">
Oferta principal: implementação de operação de atendimento e vendas no WhatsApp
O próximo passo é o diagnóstico da operação no WhatsApp.
</p>
</div>
</div>
Expand Down
Loading
Loading