@@ -345,8 +345,8 @@ func TestConfigHandler_UpdateErrorScenario(t *testing.T) {
345345 }
346346
347347 // Check the fields were stored correctly
348- if scenario . Enabled != ( tc .errorScenario .Enabled != nil && * tc .errorScenario .Enabled ) {
349- expectedEnabled := tc . errorScenario . Enabled != nil && * tc . errorScenario . Enabled
348+ expectedEnabled := tc .errorScenario .Enabled != nil && * tc .errorScenario .Enabled
349+ if scenario . Enabled != expectedEnabled {
350350 t .Errorf ("wrong enabled status stored: got %v want %v" , scenario .Enabled , expectedEnabled )
351351 }
352352 if scenario .Endpoint != tc .errorScenario .Endpoint {
@@ -489,11 +489,11 @@ func TestConfigHandler_ErrorScenarioDefaultEnabled(t *testing.T) {
489489 defaultUser := models .NewDefaultUser ()
490490 handler := NewConfigHandler (mockStore , defaultUser )
491491
492- // Test case where enabled field is not set (defaults to false in Go )
493- // but should be enabled when endpoint and error are provided
492+ // Test case where enabled field is not set (nil pointer )
493+ // Should default to true when endpoint and error are provided
494494 configReq := ConfigRequest {
495495 ErrorScenario : & ErrorScenario {
496- // Enabled field not set, defaults to false
496+ // Enabled field not set (nil), will default to true
497497 Endpoint : "authorize" ,
498498 Error : "unauthorized_client" ,
499499 ErrorDescription : "Client not authorized" ,
0 commit comments