File tree Expand file tree Collapse file tree 4 files changed +60
-1
lines changed
mcpjam-inspector/client/src Expand file tree Collapse file tree 4 files changed +60
-1
lines changed Original file line number Diff line number Diff line change @@ -291,6 +291,7 @@ export default function App() {
291291 const learningEnabled = useFeatureFlagEnabled ( "mcpjam-learning" ) ;
292292 const clientConfigEnabled = useFeatureFlagEnabled ( "client-config-enabled" ) ;
293293 const registryEnabled = useFeatureFlagEnabled ( "registry-enabled" ) ;
294+ const conformanceEnabled = useFeatureFlagEnabled ( "conformance-enabled" ) ;
294295 const playgroundEnabled = useFeatureFlagEnabled ( "playground-enabled" ) ;
295296 const evaluateRunsEnabled = useFeatureFlagEnabled ( "evaluate-runs" ) ;
296297 const {
@@ -1248,8 +1249,11 @@ export default function App() {
12481249 ( clientConfigEnabled !== true || ! isAuthenticated )
12491250 ) {
12501251 applyNavigation ( "servers" , { updateHash : true } ) ;
1252+ } else if ( activeTab === "conformance" && conformanceEnabled !== true ) {
1253+ applyNavigation ( "servers" , { updateHash : true } ) ;
12511254 }
12521255 } , [
1256+ conformanceEnabled ,
12531257 clientConfigEnabled ,
12541258 registryEnabled ,
12551259 learningEnabled ,
Original file line number Diff line number Diff line change @@ -2116,6 +2116,23 @@ describe("App hosted OAuth callback handling", () => {
21162116 expect ( screen . queryByTestId ( "ci-evals-tab" ) ) . not . toBeInTheDocument ( ) ;
21172117 } ) ;
21182118
2119+ it ( "redirects conformance to servers when the feature flag is disabled" , async ( ) => {
2120+ clearHostedOAuthPendingState ( ) ;
2121+ clearSandboxSession ( ) ;
2122+ window . history . replaceState ( { } , "" , "/#/conformance" ) ;
2123+ mockHandleOAuthCallback . mockReset ( ) ;
2124+
2125+ mockUseFeatureFlagEnabled . mockImplementation ( ( flag : string ) =>
2126+ flag === "playground-enabled" ,
2127+ ) ;
2128+
2129+ render ( < App /> ) ;
2130+
2131+ await waitFor ( ( ) => {
2132+ expect ( window . location . hash ) . toBe ( "#servers" ) ;
2133+ } ) ;
2134+ } ) ;
2135+
21192136 it ( "still applies the CI billing redirect when evaluate-runs is enabled" , async ( ) => {
21202137 clearHostedOAuthPendingState ( ) ;
21212138 clearSandboxSession ( ) ;
Original file line number Diff line number Diff line change @@ -131,6 +131,34 @@ describe("filterByFeatureFlags", () => {
131131 ) ,
132132 ) . toEqual ( [ "Playground" , "Runs" ] ) ;
133133 } ) ;
134+
135+ it ( "hides Conformance when the feature flag is off" , ( ) => {
136+ const result = filterByFeatureFlags (
137+ [
138+ {
139+ id : "others" ,
140+ items : [
141+ {
142+ title : "Conformance" ,
143+ url : "#conformance" ,
144+ icon : FakeIcon ,
145+ featureFlag : "conformance-enabled" ,
146+ } ,
147+ {
148+ title : "OAuth Debugger" ,
149+ url : "#oauth-flow" ,
150+ icon : FakeIcon ,
151+ } ,
152+ ] ,
153+ } ,
154+ ] ,
155+ { "conformance-enabled" : false } ,
156+ ) ;
157+
158+ expect ( result [ 0 ] . items . map ( ( item ) => item . title ) ) . toEqual ( [
159+ "OAuth Debugger" ,
160+ ] ) ;
161+ } ) ;
134162} ) ;
135163
136164describe ( "applyBillingGateNavState" , ( ) => {
@@ -207,7 +235,12 @@ describe("getHostedNavigationSections", () => {
207235 icon : FakeIcon ,
208236 billingFeature : "evals" ,
209237 } ,
210- { title : "Conformance" , url : "#conformance" , icon : FakeIcon } ,
238+ {
239+ title : "Conformance" ,
240+ url : "#conformance" ,
241+ icon : FakeIcon ,
242+ featureFlag : "conformance-enabled" ,
243+ } ,
211244 { title : "OAuth Debugger" , url : "#oauth-flow" , icon : FakeIcon } ,
212245 ] ,
213246 } ,
@@ -232,6 +265,7 @@ describe("getHostedNavigationSections", () => {
232265 title : "Conformance" ,
233266 url : "#conformance" ,
234267 icon : FakeIcon ,
268+ featureFlag : "conformance-enabled" ,
235269 } ,
236270 {
237271 title : "OAuth Debugger" ,
Original file line number Diff line number Diff line change @@ -249,6 +249,7 @@ const navigationSections: NavSection[] = [
249249 title : "Conformance" ,
250250 url : "#conformance" ,
251251 icon : FlaskConical ,
252+ featureFlag : "conformance-enabled" ,
252253 } ,
253254 {
254255 title : "OAuth Debugger" ,
@@ -541,6 +542,7 @@ export function MCPSidebar({
541542 const evalsEnabled = useFeatureFlagEnabled ( "evals-enabled" ) ;
542543 const evaluateRunsEnabled = useFeatureFlagEnabled ( "evaluate-runs" ) ;
543544 const learnMoreEnabled = useFeatureFlagEnabled ( "learn-more-enabled" ) ;
545+ const conformanceEnabled = useFeatureFlagEnabled ( "conformance-enabled" ) ;
544546 const { isAuthenticated } = useConvexAuth ( ) ;
545547 const { user } = useAuth ( ) ;
546548 const learningEnabled = ! ! learningFlagEnabled && isAuthenticated ;
@@ -663,13 +665,15 @@ export function MCPSidebar({
663665 "client-config-enabled" : ! ! clientConfigEnabled && isAuthenticated ,
664666 "registry-enabled" : registryEnabled === true ,
665667 "evals-enabled" : ! ! evalsEnabled ,
668+ "conformance-enabled" : conformanceEnabled === true ,
666669 } ) ,
667670 [
668671 learningEnabled ,
669672 sandboxesEnabled ,
670673 clientConfigEnabled ,
671674 registryEnabled ,
672675 evalsEnabled ,
676+ conformanceEnabled ,
673677 isAuthenticated ,
674678 ] ,
675679 ) ;
You can’t perform that action at this time.
0 commit comments