package config

import (
	"testing"

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

func TestModeBasedPaths(t *testing.T) {
	tests := []struct {
		mode         string
		wantBasePath string
		wantDataDir  string
		wantLogDir   string
	}{
		{"dev", "data/dev/experiments", "data/dev/active", "data/dev/logs"},
		{"prod", "data/prod/experiments", "data/prod/active", "data/prod/logs"},
		{"ci", "data/ci/experiments", "data/ci/active", "data/ci/logs"},
		{"prod-smoke", "data/prod-smoke/experiments", "data/prod-smoke/active", "data/prod-smoke/logs"},
		{"unknown", "data/dev/experiments", "data/dev/active", "data/dev/logs"}, // defaults to dev
	}

	for _, tt := range tests {
		t.Run(tt.mode, func(t *testing.T) {
			gotBasePath := config.ModeBasedBasePath(tt.mode)
			if gotBasePath != tt.wantBasePath {
				t.Errorf("ModeBasedBasePath(%q) = %q, want %q", tt.mode, gotBasePath, tt.wantBasePath)
			}

			gotDataDir := config.ModeBasedDataDir(tt.mode)
			if gotDataDir != tt.wantDataDir {
				t.Errorf("ModeBasedDataDir(%q) = %q, want %q", tt.mode, gotDataDir, tt.wantDataDir)
			}

			gotLogDir := config.ModeBasedLogDir(tt.mode)
			if gotLogDir != tt.wantLogDir {
				t.Errorf("ModeBasedLogDir(%q) = %q, want %q", tt.mode, gotLogDir, tt.wantLogDir)
			}
		})
	}
}
