mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-23 00:36:21 +00:00
Test message when removing autojoin for non existent bookmark
This commit is contained in:
@@ -366,3 +366,22 @@ void cmd_bookmark_remove_shows_message_when_no_bookmark(void **state)
|
||||
|
||||
free(help);
|
||||
}
|
||||
|
||||
void cmd_bookmark_remove_autojoin_shows_message_when_no_bookmark(void **state)
|
||||
{
|
||||
mock_bookmark_remove();
|
||||
mock_cons_show();
|
||||
char *jid = "room@conf.server";
|
||||
CommandHelp *help = malloc(sizeof(CommandHelp));
|
||||
gchar *args[] = { "remove", jid, "autojoin", NULL };
|
||||
|
||||
mock_connection_status(JABBER_CONNECTED);
|
||||
|
||||
expect_and_return_bookmark_remove(jid, TRUE, FALSE);
|
||||
expect_cons_show("No bookmark exists for room@conf.server.");
|
||||
|
||||
gboolean result = cmd_bookmark(args, *help);
|
||||
assert_true(result);
|
||||
|
||||
free(help);
|
||||
}
|
||||
|
||||
@@ -17,3 +17,4 @@ void cmd_bookmark_remove_removes_bookmark(void **state);
|
||||
void cmd_bookmark_remove_removes_autojoin(void **state);
|
||||
void cmd_bookmark_add_shows_message_when_upated(void **state);
|
||||
void cmd_bookmark_remove_shows_message_when_no_bookmark(void **state);
|
||||
void cmd_bookmark_remove_autojoin_shows_message_when_no_bookmark(void **state);
|
||||
|
||||
@@ -458,6 +458,7 @@ int main(int argc, char* argv[]) {
|
||||
unit_test(cmd_bookmark_remove_removes_autojoin),
|
||||
unit_test(cmd_bookmark_add_shows_message_when_upated),
|
||||
unit_test(cmd_bookmark_remove_shows_message_when_no_bookmark),
|
||||
unit_test(cmd_bookmark_remove_autojoin_shows_message_when_no_bookmark),
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user