|
@@ -1,20 +1,32 @@
|
|
|
-/*global mock, converse */
|
|
|
+/* global mock */
|
|
|
|
|
|
-const { u } = converse.env;
|
|
|
+describe("A jingle chat history message", function () {
|
|
|
|
|
|
-describe("A jingle chat message", function () {
|
|
|
+ it("has been shown in the chat",
|
|
|
+ mock.initConverse(['chatBoxesFetched'], {}, async function (_converse) {
|
|
|
|
|
|
- it("will be displayed on the initiator's",
|
|
|
- mock.initConverse(['chatBoxesFetched'], {},
|
|
|
- async function (_converse) {
|
|
|
+ await mock.waitForRoster(_converse, 'current', 1);
|
|
|
+ const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit';
|
|
|
+ await mock.openChatBoxFor(_converse, contact_jid);
|
|
|
+ const view = _converse.chatboxviews.get(contact_jid);
|
|
|
+ const call_button = view.querySelector('converse-jingle-toolbar-button button');
|
|
|
+ call_button.click();
|
|
|
+ const jingle_chat_history_component = view.querySelector('converse-jingle-message');
|
|
|
+ expect(jingle_chat_history_component).not.toBe(undefined);
|
|
|
+ }));
|
|
|
|
|
|
- await mock.waitForRoster(_converse, 'current', 1);
|
|
|
- const contact_jid = mock.cur_names[0].replace(/ /g, '.').toLowerCase() + '@montague.lit';
|
|
|
- await mock.openChatBoxFor(_converse, contact_jid);
|
|
|
- const view = _converse.chatboxviews.get(contact_jid);
|
|
|
- const call_button = view.querySelector('converse-jingle-toolbar-button button');
|
|
|
- call_button.click();
|
|
|
- const initiator_message = await u.waitUntil(() => view.querySelectorAll('converse-message-history converse-chat-message .chat-msg__text ')?.textContent === 'Initiated a Call at');
|
|
|
- expect(initiator_message).toBe().not(undefined);
|
|
|
- }));
|
|
|
+ fit("has the end call button",
|
|
|
+ mock.initConverse(['chatBoxesFetched'], {}, async function (_converse) {
|
|
|
+
|
|
|
+ await mock.waitForRoster(_converse, 'current', 1);
|
|
|
+ const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit';
|
|
|
+ await mock.openChatBoxFor(_converse, contact_jid);
|
|
|
+ const view = _converse.chatboxviews.get(contact_jid);
|
|
|
+ const call_button = view.querySelector('converse-jingle-toolbar-button button');
|
|
|
+ call_button.click();
|
|
|
+ const chatbox = view.model;
|
|
|
+ const end_call_button = view.querySelector('converse-jingle-message button .end-call');
|
|
|
+ expect(end_call_button).not.toBe(undefined);
|
|
|
+ expect(chatbox.get('jingle_status')).toBe(_converse.JINGLE_CALL_STATUS.ENDED);
|
|
|
+ }));
|
|
|
});
|