(t *testing.T)
| 930 | } |
| 931 | |
| 932 | func TestSession_ElicitationCapabilityGating(t *testing.T) { |
| 933 | t.Run("elicitation errors when capability is missing", func(t *testing.T) { |
| 934 | session, cleanup := newTestSession() |
| 935 | defer cleanup() |
| 936 | |
| 937 | err := session.assertElicitation() |
| 938 | if err == nil { |
| 939 | t.Fatal("Expected error when elicitation capability is missing") |
| 940 | } |
| 941 | expected := "elicitation is not supported" |
| 942 | if !strings.Contains(err.Error(), expected) { |
| 943 | t.Errorf("Expected error to contain %q, got %q", expected, err.Error()) |
| 944 | } |
| 945 | }) |
| 946 | |
| 947 | t.Run("elicitation succeeds when capability is present", func(t *testing.T) { |
| 948 | session, cleanup := newTestSession() |
| 949 | defer cleanup() |
| 950 | |
| 951 | session.setCapabilities(&SessionCapabilities{ |
| 952 | UI: &UICapabilities{Elicitation: true}, |
| 953 | }) |
| 954 | err := session.assertElicitation() |
| 955 | if err != nil { |
| 956 | t.Errorf("Expected no error when elicitation capability is present, got %v", err) |
| 957 | } |
| 958 | }) |
| 959 | } |
| 960 | |
| 961 | func TestSession_ElicitationHandler(t *testing.T) { |
| 962 | t.Run("registerElicitationHandler stores handler", func(t *testing.T) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…