@@ -576,17 +576,16 @@ def test_user_can_successfully_save_component_data(self, editor_for_save_tests:
576576
577577 GIVEN: A user has completed their component configuration
578578 WHEN: They save the configuration and it succeeds
579- THEN: The data should be saved and the window should close
579+ THEN: The data should be saved
580580 """
581581 # Arrange: Configure successful save operation
582582 editor_for_save_tests .data_model .save_to_filesystem .return_value = (False , "" )
583583
584584 # Act: Save component data
585585 editor_for_save_tests .save_component_json ()
586586
587- # Assert: Save operation should be attempted and window should close
587+ # Assert: Save operation should be attempted
588588 editor_for_save_tests .data_model .save_to_filesystem .assert_called_once_with (editor_for_save_tests .local_filesystem )
589- editor_for_save_tests .root .destroy .assert_called_once ()
590589
591590 def test_user_receives_error_feedback_when_save_fails (self , editor_for_save_tests : ComponentEditorWindowBase ) -> None :
592591 """
@@ -620,7 +619,7 @@ def test_user_must_confirm_before_saving_component_data(self, editor_for_save_te
620619 "ardupilot_methodic_configurator.frontend_tkinter_component_editor_base.messagebox.askyesno" , return_value = True
621620 ):
622621 # Act: Trigger validate and save operation
623- editor_for_save_tests .validate_and_save_component_json ()
622+ editor_for_save_tests .on_save_pressed ()
624623
625624 # Assert: Validation and save should proceed
626625 editor_for_save_tests .validate_data_and_highlight_errors_in_red .assert_called_once ()
@@ -644,7 +643,8 @@ def test_user_can_save_before_closing_when_prompted(self, editor_for_closing_tes
644643 WHEN: They choose to save their changes in the confirmation dialog
645644 THEN: The save operation should be executed before closing
646645 """
647- # Arrange: Mock user choosing to save
646+ # Arrange: Mock user choosing to save and a successful save operation
647+ editor_for_closing_tests .save_component_json = MagicMock (return_value = False )
648648 with (
649649 patch (
650650 "ardupilot_methodic_configurator.frontend_tkinter_component_editor_base.messagebox.askyesnocancel" ,
@@ -1021,6 +1021,9 @@ def test_user_benefits_from_consistent_ui_styling(
10211021 # Arrange: Mock the style instance
10221022 mock_style = MagicMock ()
10231023 mock_style_class .return_value = mock_style
1024+ # Provide a sensible default DPI scaling for tests so style font sizes are predictable
1025+ # 9pt base with 1.5 scaling -> int(9 * 1.5) == 13, matching test expectations
1026+ editor_for_ui_tests .dpi_scaling_factor = 1.5
10241027
10251028 # Act: Setup styles
10261029 editor_for_ui_tests ._setup_styles ()
@@ -1442,7 +1445,7 @@ def test_user_receives_validation_errors_before_save(
14421445 editor_for_validation_tests .validate_data_and_highlight_errors_in_red .return_value = error_message
14431446
14441447 # Act: Attempt to validate and save
1445- editor_for_validation_tests .validate_and_save_component_json ()
1448+ editor_for_validation_tests .on_save_pressed ()
14461449
14471450 # Assert: Error should be displayed and save should not proceed
14481451 mock_error .assert_called_once_with (_ ("Error" ), error_message )
@@ -1469,7 +1472,7 @@ def test_user_must_confirm_component_properties_before_save(
14691472 )
14701473
14711474 # Act: Attempt to validate and save
1472- editor_for_validation_tests .validate_and_save_component_json ()
1475+ editor_for_validation_tests .on_save_pressed ()
14731476
14741477 # Assert: Confirmation should be requested but save should not proceed
14751478 mock_confirm .assert_called_once ()
0 commit comments