// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// SPDX-License-Identifier: Apache-2.0

package modelgarden

import (
	"strings"
	"testing"
)

// TestDefineModel_NilOpts verifies that each plugin's DefineModel returns the
// nil-opts error after Init, without touching the underlying client. This is
// a white-box test so it can flip `initted` without running Init (which would
// require GCP credentials).
func TestDefineModel_NilOpts(t *testing.T) {
	t.Run("Anthropic", func(t *testing.T) {
		a := &Anthropic{initted: true}
		_, err := a.DefineModel("claude-test", nil)
		if err == nil || !strings.Contains(err.Error(), "nil ai.ModelOptions") {
			t.Fatalf("err = %v, want one mentioning nil ai.ModelOptions", err)
		}
	})
	t.Run("Llama", func(t *testing.T) {
		l := &Llama{initted: true}
		_, err := l.DefineModel("llama-test", nil)
		if err == nil || !strings.Contains(err.Error(), "nil ai.ModelOptions") {
			t.Fatalf("err = %v, want one mentioning nil ai.ModelOptions", err)
		}
	})
}
