From 6242e4b208d33d6dfe887ab19ace65d9060c06be Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Sat, 27 Jun 2020 07:39:53 -0700 Subject: [PATCH] Add failing test for list of judging players when judging phase begins In the answering phase, the list of answering players (the ones we are waiting for) initially starts out as empty and then gets populated only as people start typing (that is, submit a post to the "/answering" endpoint). That's appropriate since we don't know who among the players registered are really actively "playing". But that's not the right logic for the judging phase. The judging phase starts immediately after the answering phase has completed, so at that point we know the precise list of active players and we should display all of them in the "waiting" list until each has submitted. This commit adds a failing test case demonstrating that this list is empty when the judging phase starts, but it should include the names of each player that submitted an answer, (but not the name of a player that is registered but did not submit). --- test | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test b/test index 45dbbe3..703f005 100755 --- a/test +++ b/test @@ -742,6 +742,18 @@ result=$(echo $(empathy_ambiguities alice)) test "$result" != "null" TEST_END +# Usage: empathy_players_judging +empathy_players_judging() +{ + empathy_get_event $1 game-state | jq .players_judging[] +} + +TEST "Verify active players listed as judging" +# echo here is to strip newlines +result=$(echo $(empathy_players_judging alice)) +test "$result" = '"alice" "bob" "charlie"' +TEST_END + TEST "Submit word groups from majority" empathy_judged alice $prompt_id '[]' >/dev/null result=$(empathy_judged bob $prompt_id '[]') -- 2.43.0