@@ -394,7 +394,10 @@ func Test_IssueRead_IFC_InsidersMode(t *testing.T) {
394394}
395395
396396func Test_GetIssue_FieldValues (t * testing.T ) {
397- // Verify that issue_field_values from the REST API are present in the returned object.
397+ // Verify that issue_field_values from the REST API are NOT exposed when the
398+ // remote_mcp_issue_fields flag is off. The raw REST format is always cleared;
399+ // enriched field_values are only populated when the flag is on (tested via
400+ // featureCheckerFor in Test_CreateIssue and the smoke tests).
398401 serverTool := IssueRead (translations .NullTranslationHelper )
399402
400403 mockIssueWithFields := & github.Issue {
@@ -457,24 +460,9 @@ func Test_GetIssue_FieldValues(t *testing.T) {
457460 err = json .Unmarshal ([]byte (textContent .Text ), & returnedIssue )
458461 require .NoError (t , err )
459462
460- require .Len (t , returnedIssue .IssueFieldValues , 2 , "expected two issue field values" )
461-
462- first := returnedIssue .IssueFieldValues [0 ]
463- assert .Equal (t , int64 (1001 ), first .IssueFieldID )
464- assert .Equal (t , "FV_node_1" , first .NodeID )
465- assert .Equal (t , "single_select" , first .DataType )
466- assert .Equal (t , "High" , first .Value )
467- require .NotNil (t , first .SingleSelectOption )
468- assert .Equal (t , int64 (42 ), first .SingleSelectOption .ID )
469- assert .Equal (t , "High" , first .SingleSelectOption .Name )
470- assert .Equal (t , "red" , first .SingleSelectOption .Color )
471-
472- second := returnedIssue .IssueFieldValues [1 ]
473- assert .Equal (t , int64 (1002 ), second .IssueFieldID )
474- assert .Equal (t , "FV_node_2" , second .NodeID )
475- assert .Equal (t , "text" , second .DataType )
476- assert .Equal (t , "some text value" , second .Value )
477- assert .Nil (t , second .SingleSelectOption )
463+ // Flag is off: raw REST IssueFieldValues must be cleared, enriched FieldValues absent.
464+ assert .Empty (t , returnedIssue .IssueFieldValues , "raw REST issue_field_values should not be exposed when flag is off" )
465+ assert .Empty (t , returnedIssue .FieldValues , "enriched field_values should not be present when flag is off" )
478466}
479467
480468func Test_AddIssueComment (t * testing.T ) {
0 commit comments