package jupyter_test

import (
	"os"
	"testing"

	"github.com/jfraeys/fetch_ml/internal/jupyter"
)

func TestGetDefaultServiceConfig_EnvOverridesDefaultImage(t *testing.T) {
	old := os.Getenv("FETCHML_JUPYTER_DEFAULT_IMAGE")
	_ = os.Setenv("FETCHML_JUPYTER_DEFAULT_IMAGE", "quay.io/jupyter/base-notebook:latest")
	t.Cleanup(func() {
		_ = os.Setenv("FETCHML_JUPYTER_DEFAULT_IMAGE", old)
	})

	cfg := jupyter.GetDefaultServiceConfig()
	if cfg == nil {
		t.Fatalf("expected config")
	}
	if cfg.DefaultImage != "quay.io/jupyter/base-notebook:latest" {
		t.Fatalf("expected overridden image, got %q", cfg.DefaultImage)
	}
}
