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
51 lines
1.8 KiB
TypeScript
51 lines
1.8 KiB
TypeScript
import { describe, it, expect } from "vitest";
|
|||
|
|
import {
|
||
|
|
calculateSunPosition,
|
||
|
|
DEFAULT_SOLAR_SETTINGS,
|
||
|
|
SOLAR_LOCATIONS,
|
||
|
|
type SolarStudySettings,
|
||
|
|
} from "@/lib/solarSystem";
|
||
|
|
|
||
|
|
describe("Solar Study & Sun Position System (Mimari Güneş & Gölge Etüdü)", () => {
|
||
|
|
it("provides architectural location presets including Istanbul and Ankara", () => {
|
||
|
|
expect(SOLAR_LOCATIONS.length).toBeGreaterThanOrEqual(5);
|
||
|
|
const names = SOLAR_LOCATIONS.map((l) => l.name);
|
||
|
|
expect(names.some((n) => n.includes("İstanbul"))).toBe(true);
|
||
|
|
expect(names.some((n) => n.includes("Ankara"))).toBe(true);
|
||
|
|
});
|
||
|
|
|
||
|
|
it("calculates peak sun altitude at noon in June", () => {
|
||
|
|
const noonSummer: SolarStudySettings = {
|
||
|
|
...DEFAULT_SOLAR_SETTINGS,
|
||
|
|
hour: 12.0,
|
||
|
|
month: 5, // June
|
||
|
|
day: 21,
|
||
|
|
};
|
||
|
|
const pos = calculateSunPosition(noonSummer);
|
||
|
|
expect(pos.isDaylight).toBe(true);
|
||
|
|
expect(pos.altitudeDegrees).toBeGreaterThan(60); // In Istanbul, summer solstice noon is ~72 deg
|
||
|
|
expect(pos.lightVector[1]).toBeGreaterThan(150); // High Y position
|
||
|
|
});
|
||
|
|
|
||
|
|
it("calculates lower sun altitude and longer shadows in winter solstice (December)", () => {
|
||
|
|
const noonWinter: SolarStudySettings = {
|
||
|
|
...DEFAULT_SOLAR_SETTINGS,
|
||
|
|
hour: 12.0,
|
||
|
|
month: 11, // December
|
||
|
|
day: 21,
|
||
|
|
};
|
||
|
|
const pos = calculateSunPosition(noonWinter);
|
||
|
|
expect(pos.altitudeDegrees).toBeLessThan(35); // Winter noon in Istanbul is ~25-26 deg
|
||
|
|
});
|
||
|
|
|
||
|
|
it("produces warm golden hour lighting colors near sunrise/sunset", () => {
|
||
|
|
const sunsetSettings: SolarStudySettings = {
|
||
|
|
...DEFAULT_SOLAR_SETTINGS,
|
||
|
|
hour: 20.2, // Around sunset in summer in Istanbul
|
||
|
|
month: 5,
|
||
|
|
day: 21,
|
||
|
|
};
|
||
|
|
const pos = calculateSunPosition(sunsetSettings);
|
||
|
|
expect(pos.lightColorHex).toMatch(/^#(ffaa44|ffe4b5|fffcf2)$/);
|
||
|
|
});
|
||
|
|
});
|