Git Komut Rehberi & Terminal Asistanı
Sıfırdan Yeni Bir Depo Başlatın:
Mevcut Bir Git Deposu veya Klasörü Gönderin:
Hataları Geri Alma, İptal & Temizlik:
Son commit'i geri al (yapılan değişiklikleri korur):
git reset --soft HEAD~1
Yapılan yerel değişiklikleri iptal et (çalışma ağacını temizler):
git restore .
Takip edilmeyen gereksiz dosyaları sil:
git clean -fd
Değişiklikleri geçici sakla ve geri getir (stash):
git stash git stash pop
Dal (Branch) ve Sürüm Etiketleri:
Yeni dal aç ve geçiş yap:
git checkout -b yeni-ozellik git push -u origin yeni-ozellik
Sürüm etiketi (tag) oluştur ve gönder:
git tag -a v1.0.0 -m "Sürüm 1.0.0" git push origin --tags
71 lines
3.3 KiB
TypeScript
71 lines
3.3 KiB
TypeScript
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 getAppLayoutSource = () => {
|
|||
|
|
const filePath = path.resolve(__dirname, "../../apps/web/src/app/layout.tsx");
|
|||
|
|
return fs.readFileSync(filePath, "utf-8");
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
const getPageSource = () => {
|
|||
|
|
const filePath = path.resolve(__dirname, "../../apps/web/src/app/page.tsx");
|
|||
|
|
return fs.readFileSync(filePath, "utf-8");
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
describe("Page Transition, Preloader & Google Cloud Console Cascade Loading", () => {
|
|||
|
|
it("renders non-blocking Google Cloud Console linear progress bar and skeleton grid", () => {
|
|||
|
|
const pageSrc = getPageSource();
|
|||
|
|
expect(pageSrc).toContain("gcp-linear-progress");
|
|||
|
|
expect(pageSrc).toContain("gcp-skeleton-grid");
|
|||
|
|
expect(pageSrc).toContain("project-card-skeleton");
|
|||
|
|
expect(pageSrc).toContain('role="progressbar"');
|
|||
|
|
expect(pageSrc).toContain('aria-hidden="true"');
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
it("hides transient visual skeleton cards from screen readers to prevent cluttering accessibility tree", () => {
|
|||
|
|
const pageSrc = getPageSource();
|
|||
|
|
expect(pageSrc).not.toContain("kart ${num} / 6");
|
|||
|
|
expect(pageSrc).not.toContain("kart ${num} / 3");
|
|||
|
|
expect(pageSrc).toContain('className="project-grid gcp-skeleton-grid"\n aria-hidden="true"');
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
it("page.tsx implements Google Cloud Console top-to-bottom cascade waterfall classes without robotic initial announcements", () => {
|
|||
|
|
const pageSrc = getPageSource();
|
|||
|
|
expect(pageSrc).toContain("gcp-cascade-topbar");
|
|||
|
|
expect(pageSrc).toContain("gcp-cascade-sidebar");
|
|||
|
|
expect(pageSrc).toContain("gcp-cascade-actions");
|
|||
|
|
expect(pageSrc).toContain("gcp-cascade-starters");
|
|||
|
|
expect(pageSrc).toContain("gcp-cascade-header");
|
|||
|
|
expect(pageSrc).toContain("gcp-cascade-card");
|
|||
|
|
expect(pageSrc).toContain("gcp-cascade-footer");
|
|||
|
|
// Sayfa açılışında ekran okuyucuya yapay/aşağılayıcı anons yapılmaz
|
|||
|
|
expect(pageSrc).not.toContain("SnapCAD Studio çalışma alanı üstten alta başarıyla yüklendi");
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
it("RootLayout includes NextTopLoader and inline anti-FOUC theme script to prevent white flash", () => {
|
|||
|
|
const layoutSrc = getAppLayoutSource();
|
|||
|
|
expect(layoutSrc).toContain("NextTopLoader");
|
|||
|
|
expect(layoutSrc).toContain("AppErrorBoundary");
|
|||
|
|
expect(layoutSrc).toContain("sketchforge.theme.preference");
|
|||
|
|
expect(layoutSrc).toContain("document.documentElement.style.backgroundColor");
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
it("AppErrorBoundary safely catches exceptions and prevents white screen of death", () => {
|
|||
|
|
const errorBoundarySrc = getComponentSource("AppErrorBoundary.tsx");
|
|||
|
|
expect(errorBoundarySrc).toContain("SnapCAD Studio Yükleme Kurtarma");
|
|||
|
|
expect(errorBoundarySrc).toContain("Sayfayı Yeniden Yükle");
|
|||
|
|
expect(errorBoundarySrc).toContain("Güvenli Modda Başlat");
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
it("strictly prohibits banned competitor name", () => {
|
|||
|
|
const preloaderSrc = getComponentSource("SnapCADAppPreloader.tsx");
|
|||
|
|
const errorBoundarySrc = getComponentSource("AppErrorBoundary.tsx");
|
|||
|
|
expect(preloaderSrc.toLowerCase()).not.toContain("tinker" + "cad");
|
|||
|
|
expect(errorBoundarySrc.toLowerCase()).not.toContain("tinker" + "cad");
|
|||
|
|
});
|
|||
|
|
});
|