mirror of
https://github.com/deunix-educ/aventuriers-des-mots.git
synced 2026-10-13 02:11:58 +02:00
Add CM1 and CM2 boards, six backdrops and a quit button (0.8.0)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -8,6 +8,8 @@ const DATA_DIR := "res://data"
|
||||
## Mots a « h » aspire ou vocalique sans elision : « le hibou », « le onze ».
|
||||
const NO_ELISION_WORDS: Array[String] = [
|
||||
"hibou",
|
||||
"hublot",
|
||||
"hublots",
|
||||
"haie",
|
||||
"haies",
|
||||
"héros",
|
||||
|
||||
@@ -15,7 +15,7 @@ func test_unknown_rule_returns_empty_dictionary() -> void:
|
||||
|
||||
func test_missions_are_loaded_and_sorted() -> void:
|
||||
var missions := ExerciseEngine.get_missions()
|
||||
assert_eq(missions.size(), 57)
|
||||
assert_eq(missions.size(), 111)
|
||||
var ids: Array = missions.map(func(m: Dictionary) -> String: return m["mission_id"])
|
||||
assert_eq(ids, ids.duplicate()) # trivialement vrai, documente l'ordre stable
|
||||
assert_true(ids.has("mission_01_pre_des_mots"))
|
||||
@@ -26,7 +26,8 @@ func test_missions_are_loaded_and_sorted() -> void:
|
||||
func test_missions_are_filtered_by_the_level_of_their_rule() -> void:
|
||||
assert_eq(ExerciseEngine.get_missions_for_level("CE1").size(), 27)
|
||||
assert_eq(ExerciseEngine.get_missions_for_level("CE2").size(), 30)
|
||||
assert_eq(ExerciseEngine.get_missions_for_level("CM1").size(), 0)
|
||||
assert_eq(ExerciseEngine.get_missions_for_level("CM1").size(), 27)
|
||||
assert_eq(ExerciseEngine.get_missions_for_level("CM2").size(), 27)
|
||||
|
||||
|
||||
func test_regions_are_ordered_and_hold_their_missions() -> void:
|
||||
|
||||
@@ -86,3 +86,23 @@ func test_profile_creation_offers_only_levels_that_have_content() -> void:
|
||||
expected.append(level)
|
||||
assert_eq(offered, expected)
|
||||
assert_true(offered.has("CE1") and offered.has("CE2"))
|
||||
|
||||
|
||||
func test_quit_button_asks_for_confirmation_then_quits_through_the_hook() -> void:
|
||||
var quits: Array[int] = []
|
||||
GameManager.quit_hook = func() -> void: quits.append(1)
|
||||
for path in ["res://scenes/profiles/profile_select.tscn", "res://scenes/ui/settings.tscn"]:
|
||||
var scene: Control = add_child_autofree(load(path).instantiate())
|
||||
await wait_process_frames(1)
|
||||
var button: Button = scene.get_node("%QuitButton")
|
||||
var dialog: ConfirmationDialog = scene.get_node("%QuitDialog")
|
||||
assert_eq(button.text, UIText.get_text("quit.button"))
|
||||
var before_press := quits.size()
|
||||
button.pressed.emit()
|
||||
assert_true(dialog.visible, "une confirmation doit etre demandee")
|
||||
assert_eq(quits.size(), before_press, "rien ne quitte avant la confirmation")
|
||||
var before := quits.size()
|
||||
dialog.hide()
|
||||
dialog.confirmed.emit()
|
||||
assert_eq(quits.size(), before + 1)
|
||||
GameManager.quit_hook = Callable()
|
||||
|
||||
Reference in New Issue
Block a user