(t *testing.T)
| 184 | } |
| 185 | |
| 186 | func TestGraphViewPluginMetadata(t *testing.T) { |
| 187 | p := NewBuiltinGraphViewPlugin() |
| 188 | if p.Name() != "@graphview" { |
| 189 | t.Fatalf("name = %q", p.Name()) |
| 190 | } |
| 191 | if !p.IsReadOnly(nil) || p.IsConcurrencySafe(nil) { |
| 192 | t.Fatalf("capabilities: readonly=%v concurrencySafe=%v", p.IsReadOnly(nil), p.IsConcurrencySafe(nil)) |
| 193 | } |
| 194 | for _, s := range []string{p.Description(), p.Usage(), p.Version(), p.Schema()} { |
| 195 | if strings.TrimSpace(s) == "" { |
| 196 | t.Fatal("empty metadata string") |
| 197 | } |
| 198 | } |
| 199 | if p.Path() != "" { |
| 200 | t.Fatalf("path = %q, want empty", p.Path()) |
| 201 | } |
| 202 | if d := p.DescribeCall(nil); d == "" { |
| 203 | t.Fatal("empty describe") |
| 204 | } |
| 205 | if d := p.DescribeCall([]string{`{"source":"knowledge"}`}); d == "" { |
| 206 | t.Fatal("empty describe for source") |
| 207 | } |
| 208 | var js map[string]interface{} |
| 209 | if err := json.Unmarshal([]byte(p.Schema()), &js); err != nil { |
| 210 | t.Fatalf("schema not valid JSON: %v", err) |
| 211 | } |
| 212 | } |
| 213 | |
| 214 | func TestGraphViewThemeAndOpenEnv(t *testing.T) { |
| 215 | t.Setenv(graphViewThemeEnv, "light") |
nothing calls this directly
no test coverage detected