- Remove backend Medusa.js (TypeScript) e substitui pelo backend Go (saveinmed-performance-core) - Corrige testes auth.test.ts: alinha paths de API (v1/ sem barra inicial) e campo access_token - Corrige GroupedProductCard.test.tsx: ajusta distância formatada (toFixed) e troca userEvent por fireEvent com fakeTimers - Corrige AuthContext.test.tsx: usa vi.hoisted() para mocks e corrige parênteses no waitFor Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
17 lines
429 B
Go
17 lines
429 B
Go
package domain
|
|
|
|
import "testing"
|
|
|
|
func TestHaversineDistanceZero(t *testing.T) {
|
|
distance := HaversineDistance(-23.55, -46.63, -23.55, -46.63)
|
|
if distance != 0 {
|
|
t.Fatalf("expected zero distance, got %v", distance)
|
|
}
|
|
}
|
|
|
|
func TestHaversineDistanceApproximate(t *testing.T) {
|
|
distance := HaversineDistance(0, 0, 0, 1)
|
|
if distance < 110 || distance > 112 {
|
|
t.Fatalf("expected distance around 111km, got %v", distance)
|
|
}
|
|
}
|