X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=test;fp=test;h=45dbbe32fbdfc943e445d77b387b279b4c0de252;hb=c343c36604caa05d96082ec07922914fb9bf2636;hp=12da35fa8f7ce2b71ffc7f62a68d730a9d9923b0;hpb=a97fc77ab9bf93e23a5db127f4aaddb046230958;p=lmno-server diff --git a/test b/test index 12da35f..45dbbe3 100755 --- a/test +++ b/test @@ -779,6 +779,42 @@ result=$(echo $(empathy_scores alice)) test "$result" != "null" TEST_END +TEST_SUBSECTION "New game (no voting needed when all answered players judge)" + +TEST "Start 4-player game, 3 submissions" +empathy_reset +prompt_id=$(empathy_submit_prompt alice 4 "1 truth or dare" | jq .id) +empathy_start alice $prompt_id +empathy_answer alice $prompt_id '"truth"' >/dev/null +empathy_answer bob $prompt_id '"truth"' >/dev/null +empathy_answer charlie $prompt_id '"dare"' >/dev/null +empathy_end_answers alice $prompt_id +empathy_end_answers bob $prompt_id +empathy_end_answers charlie $prompt_id +test "$?" = "0" +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 + pkill -P $alice_pid pkill -P $bob_pid pkill -P $charlie_pid