Add graphical CCS Cases 2 prototype

This commit is contained in:
hz
2026-08-05 18:17:12 -05:00
parent 976cb70d4a
commit d76b2c809e
67 changed files with 2393 additions and 0 deletions
+49
View File
@@ -0,0 +1,49 @@
extends SceneTree
var failures := 0
func _initialize() -> void:
call_deferred("_run")
func _run() -> void:
var prior_environment: String = ProjectSettings.get_setting("step3/deployment_environment", "development")
ProjectSettings.set_setting("step3/deployment_environment", "uat")
var main_screen = load("res://scripts/ui/main.gd").new()
root.add_child(main_screen)
await process_frame
var nav_button := main_screen.sidebar.find_child("NavCcsCases2", true, false) as Button
_assert(nav_button != null and nav_button.visible, "UAT should expose a CCS Cases 2 navigation item")
_assert(main_screen.screens.has("ccs_cases_2"), "UAT should register the graphical CCS screen")
main_screen.queue_free()
await process_frame
ProjectSettings.set_setting("step3/deployment_environment", prior_environment)
var host := Control.new()
host.size = Vector2(1200.0, 700.0)
root.add_child(host)
var screen = load("res://scripts/ui/ccs_cases_2_screen.gd").new()
host.add_child(screen)
await process_frame
screen.on_show()
await process_frame
_assert(screen.current_view == "slot_machine", "CCS Cases 2 should open on the slot machine")
_assert(screen.active_scene != null and screen.active_scene.has_signal("continue_requested"), "slot machine should expose an embedded continue signal")
_assert(is_equal_approx(screen.stage_root.scale.x, screen.stage_root.scale.y), "the graphical stage should preserve its aspect ratio")
screen.active_scene.continue_requested.emit()
await process_frame
_assert(screen.current_view == "doctor_office", "Continue should open the doctor office without replacing the app scene")
screen.on_hide()
await process_frame
_assert(screen.active_scene == null and screen.current_view.is_empty(), "hiding CCS Cases 2 should release the prototype scene")
host.queue_free()
await process_frame
quit(1 if failures > 0 else 0)
func _assert(condition: bool, message: String) -> void:
if condition:
return
failures += 1
push_error(message)
+1
View File
@@ -0,0 +1 @@
uid://1voi721kqyhn
+2
View File
@@ -20,10 +20,12 @@ func _run() -> void:
var prior_environment: String = ProjectSettings.get_setting("step3/deployment_environment", "development")
ProjectSettings.set_setting("step3/deployment_environment", "uat")
_assert(FeatureFlags.progression_enabled(), "UAT should enable progression")
_assert(FeatureFlags.ccs_cases_2_enabled(), "UAT should enable CCS Cases 2")
for environment in ["prd", "production", "development", "unknown"]:
ProjectSettings.set_setting("step3/deployment_environment", environment)
_assert(not FeatureFlags.progression_enabled(), "%s should not enable progression" % environment)
_assert(not FeatureFlags.ccs_cases_2_enabled(), "%s should not enable CCS Cases 2" % environment)
ProjectSettings.set_setting("step3/deployment_environment", "prd")
var received: Array = []
+1
View File
@@ -14,6 +14,7 @@ func _initialize() -> void:
_assert(NavigationRoutes.key_for_screen("player") == "question_bank", "question player should map to Question Bank")
_assert(NavigationRoutes.key_for_screen("simulation_results") == "exams", "simulation results should activate Exams")
_assert(NavigationRoutes.key_for_screen("ccs_review") == "ccs", "CCS review should activate CCS Cases")
_assert(NavigationRoutes.key_for_screen("ccs_cases_2") == "ccs_cases_2", "graphical CCS should activate CCS Cases 2")
_assert(NavigationRoutes.key_for_screen("profile") == "performance", "profile should activate Performance")
_assert(NavigationRoutes.key_for_screen("map") == "study_plan", "study map should activate Study Plan")
_assert(NavigationRoutes.key_for_screen("settings") == "settings", "settings should activate Settings")