Files
snapcad-studio/tests/unit/corporateLegalPages.test.ts
T

122 lines
5.2 KiB
TypeScript
Raw Normal View History

import { describe, expect, it } from "vitest";
import fs from "node:fs";
import path from "node:path";
const getComponentSource = (filename: string) => {
const filePath = path.resolve(__dirname, "../../apps/web/src/components/snapcad", filename);
return fs.readFileSync(filePath, "utf-8");
};
const getPageSource = (pagePath: string) => {
const filePath = path.resolve(__dirname, "../../apps/web/src/app", pagePath, "page.tsx");
return fs.readFileSync(filePath, "utf-8");
};
describe("Corporate Legal Pages & YakNet Affiliation", () => {
describe("PlatformFooter", () => {
const footerSrc = getComponentSource("PlatformFooter.tsx");
it("explicitly states it is an official YakNet service and YakHub ecosystem platform", () => {
expect(footerSrc).toContain("Resmi YakNet Hizmeti • YakHub Ekosistemi");
expect(footerSrc).toContain("Resmi bir YakNet hizmetidir");
expect(footerSrc).toContain("YakHub Ekosistemi");
});
it("does not include the removed 'TR / Türkçe' language indicator", () => {
expect(footerSrc).not.toContain("TR / Türkçe");
expect(footerSrc).not.toContain("TR / Türkçe");
});
it("includes functional links for KVKK & Gizlilik, Kullanım Koşulları, and Kurumsal Güvenlik", () => {
expect(footerSrc).toContain("KVKK & Gizlilik");
expect(footerSrc).toContain("Kullanım Koşulları");
expect(footerSrc).toContain("Kurumsal Güvenlik");
expect(footerSrc).toContain("/kvkk");
expect(footerSrc).toContain("/kullanim-kosullari");
expect(footerSrc).toContain("/kurumsal-guvenlik");
});
it("links YakNet Hesap (SSO) to developer-console.yakhub.com.tr instead of non-existent account subdomain", () => {
expect(footerSrc).not.toContain("https://account.yakhub.com.tr");
expect(footerSrc).toContain('href="https://developer-console.yakhub.com.tr/profile"');
});
it("does not mention banned competitor name", () => {
expect(footerSrc.toLowerCase()).not.toContain("tinker" + "cad");
});
});
describe("KVKKPageContent & /kvkk route", () => {
const kvkkSrc = getComponentSource("KVKKPageContent.tsx");
const kvkkPageSrc = getPageSource("kvkk");
it("declares YakNet data controller and 6698 KVKK compliance", () => {
expect(kvkkSrc).toContain("KVKK ve Gizlilik Politikası");
expect(kvkkSrc).toContain("YakNet Bilgi ve İletişim Ağı (YakHub)");
expect(kvkkSrc).toContain("6698");
expect(kvkkSrc).toContain("[email protected]");
expect(kvkkSrc).toContain("Local-First");
expect(kvkkSrc).toContain("Resmi YakNet Hizmet Beyanı");
});
it("has a valid Next.js App Router page for /kvkk", () => {
expect(kvkkPageSrc).toContain("KVKKPageContent");
expect(kvkkPageSrc).toContain("PlatformFooter");
expect(kvkkPageSrc).toContain("Resmi YakNet Hizmeti • YakHub Ekosistemi");
});
it("does not mention banned competitor name", () => {
expect(kvkkSrc.toLowerCase()).not.toContain("tinker" + "cad");
expect(kvkkPageSrc.toLowerCase()).not.toContain("tinker" + "cad");
});
});
describe("TermsPageContent & /kullanim-kosullari route", () => {
const termsSrc = getComponentSource("TermsPageContent.tsx");
const termsPageSrc = getPageSource("kullanim-kosullari");
it("guarantees 100% intellectual property ownership of 3D designs to user", () => {
expect(termsSrc).toContain("Kullanım Koşulları");
expect(termsSrc).toContain("3B Modellerinizin Mülkiyeti: %100 Size Aittir");
expect(termsSrc).toContain("AGPLv3");
expect(termsSrc).toContain("YakNet");
expect(termsSrc).toContain("Resmi YakNet ve YakHub Ekosistemi Hizmeti");
});
it("has a valid Next.js App Router page for /kullanim-kosullari", () => {
expect(termsPageSrc).toContain("TermsPageContent");
expect(termsPageSrc).toContain("PlatformFooter");
expect(termsPageSrc).toContain("Resmi YakNet Hizmeti • YakHub Ekosistemi");
});
it("does not mention banned competitor name", () => {
expect(termsSrc.toLowerCase()).not.toContain("tinker" + "cad");
expect(termsPageSrc.toLowerCase()).not.toContain("tinker" + "cad");
});
});
describe("SecurityPageContent & /kurumsal-guvenlik route", () => {
const secSrc = getComponentSource("SecurityPageContent.tsx");
const secPageSrc = getPageSource("kurumsal-guvenlik");
it("documents client-side WASM geometry processing, TLS 1.3, and YakNet SSO", () => {
expect(secSrc).toContain("Kurumsal Güvenlik");
expect(secSrc).toContain("Zero-Knowledge");
expect(secSrc).toContain("TLS 1.3");
expect(secSrc).toContain("AES-256");
expect(secSrc).toContain("YakNet SSO");
expect(secSrc).toContain("YakNet Kurumsal Güvenlik Şemsiyesi");
});
it("has a valid Next.js App Router page for /kurumsal-guvenlik", () => {
expect(secPageSrc).toContain("SecurityPageContent");
expect(secPageSrc).toContain("PlatformFooter");
expect(secPageSrc).toContain("Resmi YakNet Hizmeti • YakHub Ekosistemi");
});
it("does not mention banned competitor name", () => {
expect(secSrc.toLowerCase()).not.toContain("tinker" + "cad");
expect(secPageSrc.toLowerCase()).not.toContain("tinker" + "cad");
});
});
});