(t *testing.T)
| 958 | } |
| 959 | |
| 960 | func TestCustomAPIKeyForSave(t *testing.T) { |
| 961 | m := providerTUIModel{ |
| 962 | apiKeyMasked: true, |
| 963 | apiKeyOriginal: "keep-me", |
| 964 | } |
| 965 | key, edited := m.customAPIKeyForSave() |
| 966 | if edited { |
| 967 | t.Fatal("masked key should not count as edited") |
| 968 | } |
| 969 | if key != "keep-me" { |
| 970 | t.Errorf("key = %q, want keep-me", key) |
| 971 | } |
| 972 | |
| 973 | m.apiKeyMasked = false |
| 974 | m.apiKeyInput.SetValue(" ") |
| 975 | key, edited = m.customAPIKeyForSave() |
| 976 | if !edited { |
| 977 | t.Fatal("cleared field should count as edited") |
| 978 | } |
| 979 | if key != "" { |
| 980 | t.Errorf("key = %q, want empty", key) |
| 981 | } |
| 982 | } |
| 983 | |
| 984 | func TestProviderTUI_CustomFormCreateReturnsToModelList(t *testing.T) { |
| 985 | dir := t.TempDir() |
nothing calls this directly
no test coverage detected