Skip to content

Commit

Permalink
Split admin remove user test
Browse files Browse the repository at this point in the history
  • Loading branch information
Premwoik committed Jan 24, 2022
1 parent 1be1cb2 commit e0df2b5
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions big_tests/tests/graphql_account_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ admin_account_handler() ->
admin_check_user,
admin_register_user,
admin_register_random_user,
admin_remove_user,
admin_remove_non_existing_user,
admin_remove_existing_user,
admin_ban_user,
admin_change_user_password,
admin_remove_old_users_domain,
Expand Down Expand Up @@ -216,16 +217,17 @@ admin_register_random_user(Config) ->
{ok, _} = rpc(mim(), mongoose_account_api, unregister_user, [Username, Server]).


admin_remove_user(Config) ->
% Unregister user with not existing domain
admin_remove_non_existing_user(Config) ->
Resp = execute_auth(remove_user_body(?NOT_EXISTING_JID), Config),
?assertNotEqual(nomatch, binary:match(get_err_msg(Resp), <<"not exist">>)),
% Unregister an existing user
Path = [data, account, removeUser, message],
?assertNotEqual(nomatch, binary:match(get_err_msg(Resp), <<"not exist">>)).

admin_remove_existing_user(Config) ->
escalus:fresh_story(Config, [{alice, 1}], fun(Alice) ->
Path = [data, account, removeUser, message],
BinJID = escalus_client:full_jid(Alice),
Resp4 = execute_auth(remove_user_body(BinJID), Config),
?assertNotEqual(nomatch, binary:match(get_ok_value(Path, Resp4), <<"successfully unregister">>))
?assertNotEqual(nomatch, binary:match(get_ok_value(Path, Resp4),
<<"successfully unregister">>))
end).

admin_ban_user(Config) ->
Expand Down

0 comments on commit e0df2b5

Please sign in to comment.