package cabana import ( "context" "slices" "testing" "git.golem15.com/golem15/summercms/modules/backpack" ) // TestEnabledLocalesDefaultFirstSmoke pins D-03: the form schema lists the // default locale first, so every ML control opens on the locale whose values // live in the host columns, whatever order the writer keeps. func TestEnabledLocalesDefaultFirstSmoke(t *testing.T) { db, _ := openDryRunDB(t) app := backpack.New(nil) if err := app.Publish(db); err != nil { t.Fatal(err) } if err := app.Publish[TranslationWriter](&recordingWriter{defaultLocale: "pl", enabled: []string{"en", "pl"}}); err != nil { t.Fatal(err) } svc := &service{app: app} if got := svc.enabledContentLocales(context.Background()); !slices.Equal(got, []string{"pl", "en"}) { t.Fatalf("enabledContentLocales = %v, want [pl en]", got) } }