X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=test;fp=test;h=f5f5eeb91e9b06869e96fb69438b388bdc40c6b2;hb=13f2a95476240fd9049008d1a5a5f8711b39c3fd;hp=48db90d117ca13a295f565984db5dc57c0aed463;hpb=264ea7068e22e82294829d876942877e0b9ecfc5;p=lmno-server diff --git a/test b/test index 48db90d..f5f5eeb 100755 --- a/test +++ b/test @@ -923,4 +923,51 @@ result=$(echo $(empathy_scores_names_numbers alice)) test "$result" = '"alice" 1 "bob" 1 "charlie" 0' TEST_END +TEST_SUBSECTION "Deactivated players don't block future game phase advances" + +TEST "New 3-player game, 2 submit right away" +empathy_reset +prompt_id=$(empathy_submit_prompt charlie 4 "2 legit 2 quit" | jq .id) +empathy_start alice $prompt_id +empathy_answer alice $prompt_id '"what", "gives?"' >/dev/null +empathy_answer bob $prompt_id '"so", "confused"' >/dev/null +test "$?" = "0" +TEST_END + +TEST "Judging hasn't started with player unsubmitted" +result=$(echo $(empathy_ambiguities alice)) +test "$result" = "null" +TEST_END + +TEST "Final active player submits" +result=$(empathy_answer charlie $prompt_id '"best", "category"') +test "$result" = '{"valid":true}' +TEST_END + +TEST "Judging has started (don't need inactive players)" +result=$(echo $(empathy_ambiguities alice)) +test "$result" != "null" +TEST_END + +TEST "Submit word groups from 2 players" +empathy_judged alice $prompt_id '[]' >/dev/null +result=$(empathy_judged bob $prompt_id '[]') +test "$result" = '{"valid":true}' +TEST_END + +TEST "Scoring hasn't started with player unsubmitted" +result=$(echo $(empathy_scores alice)) +test "$result" = "null" +TEST_END + +TEST "Submit word groups from last answering player" +result=$(empathy_judged charlie $prompt_id '[]') +test "$result" = '{"valid":true}' +TEST_END + +TEST "Scoring has now started" +result=$(echo $(empathy_scores alice)) +test "$result" != "null" +TEST_END + cleanup_and_report