| 1989 | } |
| 1990 | |
| 1991 | func TestCreateSessionRequest_RequestMCPApps(t *testing.T) { |
| 1992 | t.Run("sends requestMCPApps flag when EnableMCPApps is set", func(t *testing.T) { |
| 1993 | req := createSessionRequest{ |
| 1994 | RequestMCPApps: Bool(true), |
| 1995 | } |
| 1996 | data, err := json.Marshal(req) |
| 1997 | if err != nil { |
| 1998 | t.Fatalf("Failed to marshal: %v", err) |
| 1999 | } |
| 2000 | var m map[string]any |
| 2001 | if err := json.Unmarshal(data, &m); err != nil { |
| 2002 | t.Fatalf("Failed to unmarshal: %v", err) |
| 2003 | } |
| 2004 | if m["requestMcpApps"] != true { |
| 2005 | t.Errorf("Expected requestMcpApps to be true, got %v", m["requestMcpApps"]) |
| 2006 | } |
| 2007 | }) |
| 2008 | |
| 2009 | t.Run("does not send requestMcpApps when EnableMCPApps is unset", func(t *testing.T) { |
| 2010 | req := createSessionRequest{} |
| 2011 | data, _ := json.Marshal(req) |
| 2012 | var m map[string]any |
| 2013 | json.Unmarshal(data, &m) |
| 2014 | if _, ok := m["requestMcpApps"]; ok { |
| 2015 | t.Error("Expected requestMcpApps to be omitted when not set") |
| 2016 | } |
| 2017 | }) |
| 2018 | } |
| 2019 | |
| 2020 | func TestResumeSessionRequest_RequestMCPApps(t *testing.T) { |
| 2021 | t.Run("sends requestMcpApps flag when EnableMCPApps is set", func(t *testing.T) { |