From 4d3d270a0f94cbba8670a7ab9d25f8e2f4093a4e Mon Sep 17 00:00:00 2001 From: Patrick Fairbank Date: Mon, 22 Aug 2022 17:11:34 -0700 Subject: [PATCH] Update alliance selection error message when picking a team who didn't play any qualification matches. --- web/alliance_selection.go | 8 +++++++- web/alliance_selection_test.go | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/web/alliance_selection.go b/web/alliance_selection.go index 1cd4828..3dbc3d8 100755 --- a/web/alliance_selection.go +++ b/web/alliance_selection.go @@ -76,7 +76,13 @@ func (web *Web) allianceSelectionPostHandler(w http.ResponseWriter, r *http.Requ } } if !found { - web.renderAllianceSelection(w, r, fmt.Sprintf("Team %d is not present at this event.", teamId)) + web.renderAllianceSelection( + w, + r, + fmt.Sprintf( + "Team %d has not played any matches at this event and is ineligible for selection.", teamId, + ), + ) return } } diff --git a/web/alliance_selection_test.go b/web/alliance_selection_test.go index 6d45421..6677a44 100644 --- a/web/alliance_selection_test.go +++ b/web/alliance_selection_test.go @@ -118,7 +118,7 @@ func TestAllianceSelectionErrors(t *testing.T) { assert.Contains(t, recorder.Body.String(), "Invalid team number") recorder = web.postHttpResponse("/alliance_selection", "selection0_0=100") assert.Equal(t, 200, recorder.Code) - assert.Contains(t, recorder.Body.String(), "not present at this event") + assert.Contains(t, recorder.Body.String(), "ineligible for selection") recorder = web.postHttpResponse("/alliance_selection", "selection0_0=101&selection1_1=101") assert.Equal(t, 200, recorder.Code) assert.Contains(t, recorder.Body.String(), "already part of an alliance")