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
74 lines
2.1 KiB
TypeScript
74 lines
2.1 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import type { ShapeAsset } from "@/types/sketchforge";
|
|
import { makeShapeFromAsset, sceneShape, toolbarShapeAssets } from "@/lib/shapeCatalog";
|
|
|
|
describe("shape catalog", () => {
|
|
it("does not expose removed decorative shapes in the toolbar catalog", () => {
|
|
const kinds = toolbarShapeAssets.map((asset) => asset.kind);
|
|
|
|
expect(kinds).not.toContain("star");
|
|
expect(kinds).not.toContain("heart");
|
|
});
|
|
|
|
it("creates placed shapes from toolbar assets", () => {
|
|
const asset: ShapeAsset = { id: "box", name: "Box", src: "box.png", kind: "box", color: "#d41721" };
|
|
const placed = makeShapeFromAsset(asset, { x: 12, z: -8, elevation: 4 });
|
|
|
|
expect(placed.id).toMatch(/^box-/);
|
|
expect(placed).toMatchObject({
|
|
name: "Box",
|
|
kind: "box",
|
|
color: "#d41721",
|
|
x: 12,
|
|
z: -8,
|
|
elevation: 4,
|
|
size: 20,
|
|
width: 20,
|
|
depth: 20,
|
|
height: 20,
|
|
radius: 0,
|
|
steps: 10,
|
|
locked: false,
|
|
hidden: false,
|
|
});
|
|
});
|
|
|
|
it("uses shape-specific defaults for text and round profiles", () => {
|
|
const text = makeShapeFromAsset({ id: "text", name: "Text", src: "text.png", kind: "text", color: "#cf101b" });
|
|
const torus = makeShapeFromAsset({ id: "torus", name: "Torus", src: "torus.png", kind: "torus", color: "#0098c7" });
|
|
|
|
expect(text).toMatchObject({ width: 86, depth: 28, height: 10, text: "TEXT", font: "Multilanguage" });
|
|
expect(torus).toMatchObject({ size: 22, width: 22, depth: 22, height: 5 });
|
|
});
|
|
|
|
it("creates canonical scene shapes with stable defaults", () => {
|
|
const created = sceneShape({
|
|
name: "Part",
|
|
kind: "box",
|
|
color: "#d41721",
|
|
width: 12,
|
|
depth: 18,
|
|
rotation: 359.9,
|
|
mirrorX: false,
|
|
});
|
|
|
|
expect(created.id).toMatch(/^shape-/);
|
|
expect(created).toMatchObject({
|
|
name: "Part",
|
|
kind: "box",
|
|
color: "#d41721",
|
|
x: 0,
|
|
z: 0,
|
|
elevation: 0,
|
|
width: 12,
|
|
depth: 18,
|
|
height: 20,
|
|
size: 18,
|
|
rotation: 0,
|
|
locked: false,
|
|
hidden: false,
|
|
});
|
|
expect(created.mirrorX).toBeUndefined();
|
|
});
|
|
});
|