package prediction

import (
	"testing"

	"github.com/rose_cat707/luminary/internal/model"
)

func TestSplitOwnerName(t *testing.T) {
	owner, name := splitOwnerName("luminary/flux-sdxl", "comfy-local")
	if owner != "luminary" || name != "flux-sdxl" {
		t.Fatalf("got %q/%q", owner, name)
	}
	owner, name = splitOwnerName("plain-model", "")
	if owner != "luminary" || name != "plain-model" {
		t.Fatalf("got %q/%q", owner, name)
	}
}

func TestModelDescription(t *testing.T) {
	if modelDescription(model.ModelEntry{WorkflowType: model.WorkflowImg2Img}) == "" {
		t.Fatal("expected default img2img description")
	}
	if got := modelDescription(model.ModelEntry{DisplayName: "FLUX"}); got != "FLUX" {
		t.Fatalf("got %q", got)
	}
}
