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
Add workspace editor tools
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import type { WorkplaneWorkspaceSettings } from "@/types/sketchforge";
|
||||
import { DEFAULT_SNAP_GRID, DEFAULT_WORKPLANE_WORKSPACE, normalizeSnapGrid, normalizeWorkspaceSettings, workplaneSettingsFingerprint } from "./workplaneSettings";
|
||||
|
||||
describe("workplane settings helpers", () => {
|
||||
it("accepts known snap grid values and falls back for unknown values", () => {
|
||||
expect(normalizeSnapGrid("0.5 mm")).toBe("0.5 mm");
|
||||
expect(normalizeSnapGrid("Huge")).toBe(DEFAULT_SNAP_GRID);
|
||||
expect(normalizeSnapGrid(null, "Off")).toBe("Off");
|
||||
});
|
||||
|
||||
it("normalizes workspace settings from partial or invalid data", () => {
|
||||
const fallback: WorkplaneWorkspaceSettings = {
|
||||
...DEFAULT_WORKPLANE_WORKSPACE,
|
||||
width: 300,
|
||||
depth: 250,
|
||||
background: "#ffffff",
|
||||
};
|
||||
|
||||
expect(normalizeWorkspaceSettings(null, fallback)).toEqual(fallback);
|
||||
expect(
|
||||
normalizeWorkspaceSettings(
|
||||
{
|
||||
width: 500,
|
||||
depth: Number.NaN,
|
||||
sizePreset: "",
|
||||
gridBlockSize: 2.5,
|
||||
gridBlockPreset: "Custom",
|
||||
background: "#123456",
|
||||
showShadows: false,
|
||||
showGrid: false,
|
||||
cruiseShapes: false,
|
||||
zoomSpeed: Infinity,
|
||||
units: "Bricks",
|
||||
scale: "1:10 (centimeters)",
|
||||
},
|
||||
fallback,
|
||||
),
|
||||
).toEqual({
|
||||
...fallback,
|
||||
width: 500,
|
||||
gridBlockSize: 2.5,
|
||||
gridBlockPreset: "Custom",
|
||||
background: "#123456",
|
||||
showShadows: false,
|
||||
showGrid: false,
|
||||
cruiseShapes: false,
|
||||
units: "Bricks",
|
||||
scale: "1:10 (centimeters)",
|
||||
});
|
||||
});
|
||||
|
||||
it("fingerprints workspace and snap settings together", () => {
|
||||
const base = workplaneSettingsFingerprint(DEFAULT_WORKPLANE_WORKSPACE, "1.0 mm");
|
||||
const changedSnap = workplaneSettingsFingerprint(DEFAULT_WORKPLANE_WORKSPACE, "5.0 mm");
|
||||
const changedWorkspace = workplaneSettingsFingerprint({ ...DEFAULT_WORKPLANE_WORKSPACE, width: 300 }, "1.0 mm");
|
||||
|
||||
expect(changedSnap).not.toBe(base);
|
||||
expect(changedWorkspace).not.toBe(base);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user