mirror of
https://github.com/profanity-im/profanity.git
synced 2025-01-03 14:57:42 -05:00
Added test for when autojoin no nick on /bookmark add
This commit is contained in:
parent
ebafc19220
commit
38d8d8d984
@ -198,6 +198,25 @@ void cmd_bookmark_add_adds_bookmark_with_jid_nick(void **state)
|
||||
free(help);
|
||||
}
|
||||
|
||||
void cmd_bookmark_add_adds_bookmark_with_jid_autojoin(void **state)
|
||||
{
|
||||
mock_bookmark_add();
|
||||
mock_cons_show();
|
||||
char *jid = "room@conf.server";
|
||||
CommandHelp *help = malloc(sizeof(CommandHelp));
|
||||
gchar *args[] = { "add", jid, "autojoin", NULL };
|
||||
|
||||
mock_connection_status(JABBER_CONNECTED);
|
||||
|
||||
expect_bookmark_add(jid, NULL, TRUE);
|
||||
expect_cons_show("Bookmark added for room@conf.server, autojoin enabled.");
|
||||
|
||||
gboolean result = cmd_bookmark(args, *help);
|
||||
assert_true(result);
|
||||
|
||||
free(help);
|
||||
}
|
||||
|
||||
void cmd_bookmark_add_adds_bookmark_with_jid_nick_autojoin(void **state)
|
||||
{
|
||||
mock_bookmark_add();
|
||||
|
@ -9,6 +9,7 @@ void cmd_bookmark_add_shows_usage_when_no_args_not_muc(void **state);
|
||||
void cmd_bookmark_remove_shows_message_when_no_args_not_muc(void **state);
|
||||
void cmd_bookmark_add_adds_bookmark_with_jid(void **state);
|
||||
void cmd_bookmark_add_adds_bookmark_with_jid_nick(void **state);
|
||||
void cmd_bookmark_add_adds_bookmark_with_jid_autojoin(void **state);
|
||||
void cmd_bookmark_add_adds_bookmark_with_jid_nick_autojoin(void **state);
|
||||
void cmd_bookmark_add_adds_bookmark_with_room_details(void **state);
|
||||
void cmd_bookmark_add_adds_bookmark_with_room_details_autojoin(void **state);
|
||||
|
@ -450,6 +450,7 @@ int main(int argc, char* argv[]) {
|
||||
unit_test(cmd_bookmark_remove_shows_message_when_no_args_not_muc),
|
||||
unit_test(cmd_bookmark_add_adds_bookmark_with_jid),
|
||||
unit_test(cmd_bookmark_add_adds_bookmark_with_jid_nick),
|
||||
unit_test(cmd_bookmark_add_adds_bookmark_with_jid_autojoin),
|
||||
unit_test(cmd_bookmark_add_adds_bookmark_with_jid_nick_autojoin),
|
||||
unit_test(cmd_bookmark_add_adds_bookmark_with_room_details),
|
||||
unit_test(cmd_bookmark_add_adds_bookmark_with_room_details_autojoin),
|
||||
|
Loading…
Reference in New Issue
Block a user