1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-11-03 19:37:16 -05:00

Added functional test for muc console message

This commit is contained in:
James Booth 2015-12-20 03:11:02 +00:00
parent 9f34373b46
commit 94169705b5
3 changed files with 32 additions and 1 deletions

View File

@ -94,7 +94,7 @@ int main(int argc, char* argv[]) {
PROF_FUNC_TEST(shows_history_message),
PROF_FUNC_TEST(shows_occupant_join),
PROF_FUNC_TEST(shows_message),
PROF_FUNC_TEST(shows_message_in_console_when_window_not_focussed),
};
return run_tests(all_tests);

View File

@ -222,3 +222,33 @@ shows_message(void **state)
assert_true(prof_output_regex("testoccupant: .+a new message"));
}
void
shows_message_in_console_when_window_not_focussed(void **state)
{
prof_connect();
stbbr_for_id("prof_join_2",
"<presence id=\"prof_join_2\" lang=\"en\" to=\"stabber@localhost/profanity\" from=\"testroom@conference.localhost/stabber\">"
"<c hash=\"sha-1\" xmlns=\"http://jabber.org/protocol/caps\" node=\"http://www.profanity.im\" ver=\"*\"/>"
"<x xmlns=\"http://jabber.org/protocol/muc#user\">"
"<item role=\"participant\" jid=\"stabber@localhost/profanity\" affiliation=\"none\"/>"
"</x>"
"<status code=\"110\"/>"
"</presence>"
);
prof_input("/join testroom@conference.localhost");
assert_true(prof_output_exact("-> You have joined the room as stabber, role: participant, affiliation: none"));
prof_input("/win 1");
prof_output_exact("Profanity. Type /help for help informatiosn.");
stbbr_send(
"<message type=\"groupchat\" to=\"stabber@localhost/profanity\" from=\"testroom@conference.localhost/testoccupant\">"
"<body>a new message</body>"
"</message>"
);
assert_true(prof_output_exact("<< incoming from testoccupant in testroom@conference.localhost (win 2)"));
}

View File

@ -8,3 +8,4 @@ void shows_subject_on_join(void **state);
void shows_history_message(void **state);
void shows_occupant_join(void **state);
void shows_message(void **state);
void shows_message_in_console_when_window_not_focussed(void **state);