test(goal): assert /goal membership, not the exact passthrough list literal
#6962 adds 'stop' to the busy-command passthrough list in messages.js so a busy /stop cancels immediately. test_frontend_has_goal_slash_command_and_status_event_handler asserted the exact list literal, so it failed on a change that does not affect /goal. Assert that 'goal' is a member of the list instead. Verified the assertion still fails when 'goal' is actually removed from the list.
This commit is contained in:
1 parent
70dd8e4a4b
commit
dc9911739d
1 file changed
+8
-1
@@ -671,7 +671,14 @@ def test_frontend_has_goal_slash_command_and_status_event_handler():
|
|||||||
assert "goal'" in MESSAGES_JS
|
assert "goal'" in MESSAGES_JS
|
||||||
assert "source.addEventListener('goal'" in MESSAGES_JS
|
assert "source.addEventListener('goal'" in MESSAGES_JS
|
||||||
assert "source.addEventListener('goal_continue'" in MESSAGES_JS
|
assert "source.addEventListener('goal_continue'" in MESSAGES_JS
|
||||||
assert "['steer','interrupt','queue','terminal','goal','yolo'].includes(_pc.name)" in MESSAGES_JS
|
# #6962 added 'stop' to this busy-command passthrough list so a busy /stop
|
||||||
|
# cancels immediately. Assert /goal's membership rather than the exact list
|
||||||
|
# literal, so adding another passthrough command does not fail this test.
|
||||||
|
_passthrough = re.search(
|
||||||
|
r"if\(_pc&&\[([^\]]*)\]\.includes\(_pc\.name\)\)", MESSAGES_JS
|
||||||
|
)
|
||||||
|
assert _passthrough, "busy-command passthrough list not found in messages.js"
|
||||||
|
assert "'goal'" in _passthrough.group(1)
|
||||||
assert "queueSessionMessage" in MESSAGES_JS
|
assert "queueSessionMessage" in MESSAGES_JS
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user