def test_get_billing_information(graphql_request): info = graphql_request("billingInformation") required_fields = [ "email", "name", "line1", "city", "state", "country", "postalCode", ] assert all(isinstance(v, str) for v in info.values()) assert all(len(info[key]) > 0 for key in required_fields) def test_get_payment_method(graphql_request): payment_method = graphql_request("paymentMethod") assert payment_method is not None def test_update_billing_information(graphql_request, random_string): random_name = f"Test-{random_string}" random_line_1 = f"Kentmanni 4 - {random_string}" random_city = f"Tallinn - {random_string}" random_state = f"Harjumaa - {random_string}" info = graphql_request( "updateBillingInformation", { "billilingInformation": { "email": "test@fansifter.com", "name": random_name, "line1": random_line_1, "city": random_city, "state": random_state, "country": "EE", "postalCode": "10000", } }, ) assert info['name'] == random_name assert info['line1'] == random_line_1 assert info['city'] == random_city assert info['state'] == random_state # TODO test other mutations