feat: harden portfolio and add SEO foundations
This commit is contained in:
1 parent
b079afdd73
commit
62bcfbd8fa
121 files changed
+7769
-10469
No files matched your search
@@ -1,8 +1,8 @@
|
||||
import { getLiveFeaturedProjects } from "./portfolio-data";
|
||||
import { getFeaturedProjects, portfolio } from "./portfolio-data";
|
||||
import type { ProjectHealthSnapshot } from "./project-health";
|
||||
|
||||
describe("getLiveFeaturedProjects", () => {
|
||||
it("returns only featured projects validated in the current snapshot", () => {
|
||||
describe("getFeaturedProjects", () => {
|
||||
it("keeps every featured project and classifies demo availability", () => {
|
||||
const snapshot: ProjectHealthSnapshot = {
|
||||
checkedAt: "2026-07-10T12:00:00.000Z",
|
||||
projects: {
|
||||
@@ -14,11 +14,76 @@ describe("getLiveFeaturedProjects", () => {
|
||||
},
|
||||
};
|
||||
|
||||
const result = getFeaturedProjects(snapshot);
|
||||
|
||||
expect(result.map(({ id }) => id)).toEqual(
|
||||
portfolio.projects
|
||||
.filter(({ featured }) => featured !== false)
|
||||
.map(({ id }) => id),
|
||||
);
|
||||
expect(
|
||||
getLiveFeaturedProjects(
|
||||
snapshot,
|
||||
new Date("2026-07-10T12:01:00.000Z"),
|
||||
).map((project) => project.id),
|
||||
).toEqual(["sev-modaintima"]);
|
||||
result.find(({ id }) => id === "sev-modaintima")?.demoAvailability,
|
||||
).toBe("available");
|
||||
expect(
|
||||
result.find(({ id }) => id === "sev-modaintima")?.demoCheckedAt,
|
||||
).toBe("2026-07-10T12:00:00.000Z");
|
||||
expect(result.find(({ id }) => id === "twins-lab")?.demoAvailability).toBe(
|
||||
"unknown",
|
||||
);
|
||||
expect(
|
||||
result.find(({ id }) => id === "twins-lab")?.demoCheckedAt,
|
||||
).toBeNull();
|
||||
});
|
||||
|
||||
it("excludes an isolated featured false fixture and restores the portfolio", () => {
|
||||
const originalLength = portfolio.projects.length;
|
||||
const hiddenProject = {
|
||||
...portfolio.projects[0],
|
||||
id: "hidden-test-fixture",
|
||||
featured: false,
|
||||
};
|
||||
portfolio.projects.push(hiddenProject);
|
||||
|
||||
try {
|
||||
expect(
|
||||
getFeaturedProjects(null).some(
|
||||
({ id }) => id === "hidden-test-fixture",
|
||||
),
|
||||
).toBe(false);
|
||||
} finally {
|
||||
portfolio.projects.length = originalLength;
|
||||
}
|
||||
|
||||
expect(portfolio.projects).toHaveLength(originalLength);
|
||||
});
|
||||
});
|
||||
|
||||
describe("factual portfolio records", () => {
|
||||
function serializeProject(id: string) {
|
||||
const project = portfolio.projects.find((item) => item.id === id);
|
||||
expect(project).toBeDefined();
|
||||
if (!project) throw new Error(`Missing project ${id}`);
|
||||
return JSON.stringify(project);
|
||||
}
|
||||
|
||||
it("keeps every public field of the three cases within verified claims", () => {
|
||||
const nutriscan = serializeProject("nutriscan");
|
||||
const twins = serializeProject("twins-lab");
|
||||
const asServicos = serializeProject("as-servicos");
|
||||
|
||||
expect(nutriscan).toContain("Open Food Facts");
|
||||
expect(nutriscan).not.toMatch(
|
||||
/Next\.js\s*\d|PWA|Service Worker|MongoDB|históric|scanner|offline|NutriScore|produç|24\/7|2M\+|disponibilidade|volume de produtos|resultado de saúde/i,
|
||||
);
|
||||
|
||||
expect(twins).toContain("SSE");
|
||||
expect(twins).not.toMatch(
|
||||
/WebSockets?|OpenRouter|sub[- ]segundo|produç|preditiv|ROI|precisão|equipamento real/i,
|
||||
);
|
||||
|
||||
expect(asServicos).toContain("Three.js");
|
||||
expect(asServicos).not.toMatch(
|
||||
/produç|clientes?|leads?|ranking|performance|resultado comercial|anime\.js|shadcn/i,
|
||||
);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user