Ajoute l'assistant IA "Ruby" (Claude + Scenario) et corrige plusieurs bugs de la scène
Intègre un chat IA capable de manipuler la scène via les mêmes fonctions que l'éditeur manuel (objets, variables, déclencheurs, images générées), avec conversations multiples par écran façon Claude. Corrige au passage le rafraîchissement pjax hors-ordre, l'onglet IA/déclencheurs vide après sélection d'un objet, la comparaison de booléens dans les conditions, et le blocage du glisser-déposer hors du cadre caméra après un redimensionnement de fond par l'IA. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
ab6635eee0
commit
b07b231a61
@@ -72,3 +72,50 @@ def test_variables_tab_lists_existing_variables_in_the_scene_edit_page(client, g
|
||||
html = client.get(f"/game/{game}/screens/{screen_id}/edit").get_data(as_text=True)
|
||||
assert "score_total" in html
|
||||
assert 'data-tab="variables"' in html
|
||||
|
||||
|
||||
# ---------- Réponse AJAX (voir static/js/scenes/global-variables.js) —
|
||||
# demande explicite : plus de rechargement de page pour créer/modifier/
|
||||
# supprimer une variable. ----------
|
||||
|
||||
def test_create_global_var_ajax_returns_the_row_html_without_redirecting(client, game):
|
||||
screen_id = _create_screen(client, game)
|
||||
resp = client.post(
|
||||
f"/game/{game}/variables/new",
|
||||
data={"name": "score_total", "type": "nombre_entier", "default_value": "0", "screen_id": screen_id},
|
||||
headers={"X-Requested-With": "fetch"},
|
||||
)
|
||||
assert resp.status_code == 200
|
||||
body = resp.get_json()
|
||||
assert body["ok"] is True
|
||||
assert "score_total" in body["row_html"]
|
||||
assert 'data-var-row="' in body["row_html"]
|
||||
|
||||
|
||||
def test_global_var_edit_ajax_returns_ok_without_redirecting(client, game):
|
||||
screen_id = _create_screen(client, game)
|
||||
client.post(f"/game/{game}/variables/new", data={"name": "score_total", "type": "nombre_entier", "default_value": "0", "screen_id": screen_id})
|
||||
var_id = db.list_global_variables(game)[0]["id"]
|
||||
|
||||
resp = client.post(
|
||||
f"/game/{game}/variables/{var_id}/edit",
|
||||
data={"type": "texte", "value": "beaucoup"},
|
||||
headers={"X-Requested-With": "fetch"},
|
||||
)
|
||||
assert resp.status_code == 200
|
||||
assert resp.get_json() == {"ok": True}
|
||||
assert db.list_global_variables(game)[0]["value"] == "beaucoup"
|
||||
|
||||
|
||||
def test_global_var_delete_ajax_returns_ok_without_redirecting(client, game):
|
||||
screen_id = _create_screen(client, game)
|
||||
client.post(f"/game/{game}/variables/new", data={"name": "score_total", "screen_id": screen_id})
|
||||
var_id = db.list_global_variables(game)[0]["id"]
|
||||
|
||||
resp = client.post(
|
||||
f"/game/{game}/variables/{var_id}/delete",
|
||||
headers={"X-Requested-With": "fetch"},
|
||||
)
|
||||
assert resp.status_code == 200
|
||||
assert resp.get_json() == {"ok": True}
|
||||
assert db.list_global_variables(game) == []
|
||||
|
||||
Reference in New Issue
Block a user