diff --git a/deploy/dev/test_all_apis.py b/deploy/dev/test_all_apis.py index 4aa4a59..ca5eb25 100644 --- a/deploy/dev/test_all_apis.py +++ b/deploy/dev/test_all_apis.py @@ -801,6 +801,36 @@ def phase7_shop(s_owner: Session, s_invited_player: Session, owner_user_id, invi body, ) + # Reject invitation flow: re-invite the removed player, then reject + code, body, _ = s_owner.post( + f"{GATEWAY}/api/v1/shops/{shop_id}/invitations", + json_body={"playerId": invited_player_id}, + headers=csrf, + ) + report(f"POST /shops/{shop_id}/invitations (re-invite)", code, body) + + code, body, _ = s_owner.get( + f"{GATEWAY}/api/v1/shops/{shop_id}/invitations", + ) + reinvite_id = 0 + for item in pick_items(body): + if ( + as_int(item.get("playerId")) == invited_player_id + and item.get("status") == "pending" + ): + reinvite_id = as_int(item.get("id")) + break + if reinvite_id: + code, body, _ = s_invited_player.delete( + f"{GATEWAY}/api/v1/shops/invitations/{reinvite_id}", + headers=s_invited_player.csrf_headers(), + ) + report( + f"DELETE /shops/invitations/{reinvite_id} (reject)", + code, + body, + ) + code, body, _ = s_owner.get(f"{GATEWAY}/api/v1/shops/mine") report("GET /shops/mine", code, body)