Split compose dev/prod and relax contact form friction.
Use compose.dev.yaml and compose.prod.yaml with fixed Go cache mounts, block sudo make dev, build Air outside app/tmp for rootless Docker, soften English spam checks, and simplify contact error copy. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
29
app/internal/contactcheck/english_test.go
Normal file
29
app/internal/contactcheck/english_test.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package contactcheck
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestValidateEnglish_acceptsPlainEnglish(t *testing.T) {
|
||||
if err := ValidateEnglish("Jimmy", "Hello, I need help with an LED install."); err != nil {
|
||||
t.Fatalf("unexpected error: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestValidateEnglish_acceptsTechnicalEnglish(t *testing.T) {
|
||||
msg := "Need a quote for 50m WS2812 strip + ESP32 controller in Auckland."
|
||||
if err := ValidateEnglish("Alex", msg); err != nil {
|
||||
t.Fatalf("unexpected error: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestValidateEnglish_rejectsNonLatinScript(t *testing.T) {
|
||||
msg := "これは日本語のテストメッセージです。十分な長さがあります。"
|
||||
if err := ValidateEnglish("Jimmy", msg); err != ErrNotEnglish {
|
||||
t.Fatalf("got %v, want ErrNotEnglish", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestValidateEnglish_rejectsTooShort(t *testing.T) {
|
||||
if err := ValidateEnglish("Jimmy", "Hi there"); err != ErrTooShort {
|
||||
t.Fatalf("got %v, want ErrTooShort", err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user