gb_action_log_test

AUTO-GENERATED FILE – DO NOT EDIT MANUALLY

Tests for GBActionLog UI component validation and message display functionality Validates that build/validation results are displayed correctly based on ActionLogSettings configuration

Source File: /addons/grid_building/test/ui/templates/gb_action_log_test.gd

Extends: GdUnitTestSuite

Properties

  • Property: action_log: [GBActionLog](./gb-action-log/)
  • Property: message_label: RichTextLabel
  • Property: test_settings: [ActionLogSettings](./action-log-settings/)
  • Property: test_container: [GBCompositionContainer](./gb-composition-container/)

Constants

  • Constant: TEST_COLLISION_COUNT: int = 5
  • Constant: TEST_TILE_POSITION: String = "(5, 3)"
  • Constant: EXPECTED_RULE_COUNT: int = 2
  • Constant: DEFAULT_BUILDING_NAME: String = "TestBuilding"
  • Constant: SMITHY_BUILDING_NAME: String = "TestSmithyBuilding"
  • Constant: HOUSE_BUILDING_NAME: String = "TestHouseBuilding"
  • Constant: COLLISION_FAILURE_REASON: String = "Colliding on 5 tile(s)"
  • Constant: STRUCTURE_BLOCKING_REASON: String = "Blocked by existing structure"
  • Constant: VALIDATION_FAILED_MESSAGE: String = "Placement validation failed with issues."
  • Constant: COLLISION_AT_TILE_REASON: String = "Collision detected at tile (5, 3)"
  • Constant: OUTSIDE_BOUNDARY_REASON: String = "Outside tilemap boundary"
  • Constant: SUCCESS_VALIDATION_MESSAGE: String = "Validation passed successfully"
  • Constant: NO_COLLISION_SUCCESS_REASON: String = "No collisions detected"
  • Constant: WITHIN_BOUNDS_SUCCESS_REASON: String = "Position within valid bounds"

Public Methods

before_test

1
before_test() -> void

after_test

1
after_test() -> void

test_append_validation_results_shows_failed_reasons_when_enabled

1
test_append_validation_results_shows_failed_reasons_when_enabled() -> void

Test: append_validation_results shows failed reasons when print_failed_reasons=true Setup: ActionLogSettings with print_failed_reasons=true, failed validation results Act: Call append_validation_results with failed ValidationResults Assert: Both validation message and detailed failure reasons appear in log


test_append_validation_results_respects_disabled_failed_reasons

1
test_append_validation_results_respects_disabled_failed_reasons() -> void

Test: append_validation_results respects print_failed_reasons=false setting Setup: ActionLogSettings with print_failed_reasons=false, failed validation results Act: Call append_validation_results with failed ValidationResults Assert: Detailed failure reasons are hidden from log


test_handle_build_result_shows_placement_report_issues

1
test_handle_build_result_shows_placement_report_issues() -> void

Test: _handle_build_result shows high-level placement report issues Setup: BuildActionData with PlacementReport containing high-level issues Act: Call _handle_build_result with failed build Assert: High-level issues appear in log


test_build_failure_should_show_detailed_rule_validation

1
test_build_failure_should_show_detailed_rule_validation() -> void

Test: build failure should show detailed rule validation when print_failed_reasons enabled


test_append_validation_results_shows_success_reasons_when_enabled

1
test_append_validation_results_shows_success_reasons_when_enabled() -> void

Test: append_validation_results shows success reasons when print_success_reasons=true Setup: ActionLogSettings with print_success_reasons=true, successful validation results Act: Call append_validation_results with successful ValidationResults Assert: Success message and detailed success reasons appear in log


test_append_validation_results_respects_disabled_success_reasons

1
test_append_validation_results_respects_disabled_success_reasons() -> void

Test: append_validation_results respects print_success_reasons=false setting Setup: ActionLogSettings with print_success_reasons=false, successful validation results Act: Call append_validation_results with successful ValidationResults Assert: Only validation message appears, detailed success reasons are hidden


test_handle_build_result_respects_print_failed_reasons_setting

1
test_handle_build_result_respects_print_failed_reasons_setting() -> void

Test: _handle_build_result shows detailed failure reasons when print_failed_reasons=true Setup: ActionLogSettings with print_failed_reasons=true, failed build with placement issues Act: Call _handle_build_result with failed BuildActionData Assert: Both main failure message and detailed reasons appear in log


test_handle_build_result_hides_details_when_print_failed_reasons_disabled

1
test_handle_build_result_hides_details_when_print_failed_reasons_disabled() -> void

Test: _handle_build_result hides detailed reasons when print_failed_reasons=false Setup: ActionLogSettings with print_failed_reasons=false, failed build with placement issues Act: Call _handle_build_result with failed BuildActionData Assert: Only main failure message appears, detailed reasons are hidden


Private Methods

_create_failed_validation_results

1
_create_failed_validation_results() -> ValidationResults

Flags: private

Creates a standard failed ValidationResults with collision and structure blocking issues


_create_successful_validation_results

1
2
3
_create_successful_validation_results(
    include_reasons: bool = false
) -> ValidationResults

Flags: private

Creates a successful ValidationResults with optional success reasons


_create_placement_report_with_issues

1
_create_placement_report_with_issues(issues: Array[String]) -> PlacementReport

Flags: private

Creates a PlacementReport with specified issues


_create_build_action_data

1
2
3
4
_create_build_action_data(
    building_name: String,
    placement_report: PlacementReport
) -> BuildActionData

Flags: private

Creates BuildActionData with specified placeable name and placement report


_assert_failure_messages_present

1
2
3
4
5
_assert_failure_messages_present(
    log_text: String,
    building_name: String,
    expected_reasons: Array[String]
) -> void

Flags: private

Asserts that log contains expected failure messages with proper diagnostic context


_assert_failure_messages_absent

1
2
3
4
_assert_failure_messages_absent(
    log_text: String,
    absent_reasons: Array[String]
) -> void

Flags: private

Asserts that log does not contain specified failure reasons



Grid Building v5.0.8 | Generated 24/05/2026