From 902d65ef7fe606d1105a6b666aa31256e1eed019 Mon Sep 17 00:00:00 2001 From: Florian Aucomte <33633200+faucomte97@users.noreply.github.com> Date: Fri, 17 Nov 2023 10:48:58 +0000 Subject: [PATCH] fix: Compile cow block properly (#1524) --- game/end_to_end_tests/test_play_through.py | 7 ------- game/static/game/js/blocklyCompiler.js | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/game/end_to_end_tests/test_play_through.py b/game/end_to_end_tests/test_play_through.py index 391b55908..326dbecbb 100644 --- a/game/end_to_end_tests/test_play_through.py +++ b/game/end_to_end_tests/test_play_through.py @@ -1,5 +1,3 @@ -import pytest - from .base_game_test import BaseGameTest @@ -141,12 +139,9 @@ def test_level_036(self): def test_level_037(self): self._complete_level(37) - # TODO: Fix cow tests - @pytest.mark.skip(reason="Cow tests are broken") def test_level_038(self): self._complete_level(38) - @pytest.mark.skip(reason="Cow tests are broken") def test_level_039(self): self._complete_level(39, check_route_score=False) @@ -174,8 +169,6 @@ def test_level_045(self): def test_level_046(self): self._complete_level(46) - # TODO: Fix cow tests - @pytest.mark.skip(reason="Cow tests are broken") def test_level_047(self): self._complete_level(47) diff --git a/game/static/game/js/blocklyCompiler.js b/game/static/game/js/blocklyCompiler.js index cc181fc98..f97ba4770 100644 --- a/game/static/game/js/blocklyCompiler.js +++ b/game/static/game/js/blocklyCompiler.js @@ -241,7 +241,7 @@ ocargo.BlocklyCompiler.prototype.getCondition = function (conditionBlock) { ); } else if (conditionBlock.type === "traffic_light") { return this.trafficLightCondition(conditionBlock); - } else if (conditionBlock.type === "declare_event") { + } else if (conditionBlock.type === "cow_crossing") { return this.cowCrossingCondition(conditionBlock); } else if (conditionBlock.type === "logic_compare") { return this.logicCompareCondition(conditionBlock);