Files
snapcad-studio/tests/unit/exportNames.test.ts
T
Enes Yakıştır 33b0940012
Build and Push Docker Images / build (push) Canceled after 0s
CI / Typecheck and unit tests (push) Canceled after 0s
feat: SnapCAD Studio'yu YakHub deposuna taşı
- DWG/DXF içe aktarma ve .skf yeniden açma düzeltmeleri

- YakNet Bulut eşitlemede boş/eski kopya koruması ve yerel-only proje bildirimi

- Panelden içe aktarma duyuruları ve erişilebilir Türkçe hata mesajları

- AGPL-3.0 lisansı, README ve YakHub bağlantıları
2026-10-25 18:20:21 +03:00

24 lines
1.3 KiB
TypeScript

import { describe, expect, it } from "vitest";
import { projectExportFileName } from "@/lib/exportNames";
describe("project export filenames", () => {
it("uses the project name for each supported export format", () => {
expect(projectExportFileName("Gearbox Prototype", "3mf")).toBe("Gearbox Prototype.3mf");
expect(projectExportFileName("Gearbox Prototype", "stl")).toBe("Gearbox Prototype.stl");
expect(projectExportFileName("Gearbox Prototype", "obj")).toBe("Gearbox Prototype.obj");
expect(projectExportFileName("Gearbox Prototype", "step")).toBe("Gearbox Prototype.step");
expect(projectExportFileName("Gearbox Prototype", "dxf")).toBe("Gearbox Prototype.dxf");
expect(projectExportFileName("Gearbox Prototype", "glb")).toBe("Gearbox Prototype.glb");
expect(projectExportFileName("Gearbox Prototype", "svg")).toBe("Gearbox Prototype.svg");
expect(projectExportFileName("Gearbox Prototype", "skf")).toBe("Gearbox Prototype.skf");
});
it("removes filesystem-reserved characters without discarding the project name", () => {
expect(projectExportFileName(' enclosure: v2 / final? ', "stl")).toBe("enclosure- v2 - final-.stl");
});
it("falls back to a useful name when the project name cannot be used", () => {
expect(projectExportFileName("...", "obj")).toBe("SketchForge design.obj");
});
});