Skip to content

Commit

Permalink
additional tests for jingle
Browse files Browse the repository at this point in the history
  • Loading branch information
PawBud committed Jun 30, 2022
1 parent 97b737d commit 4eb696e
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/plugins/jingle/styles/jingle.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.conversejs {
.chatbox {
.chat-head {
.button-color{
color: var(--chat-head-text-color) !important;
}
}
}
}
24 changes: 24 additions & 0 deletions src/plugins/jingle/tests/jingle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* global mock */

describe("A Call Button", function () {

it("has been shown in the toolbar",
mock.initConverse(['chatBoxesFetched'], {}, async function (_converse) {

await mock.waitForRoster(_converse, 'current');
await mock.openControlBox(_converse);
const contact_jid = mock.cur_names[2].replace(/ /g,'.').toLowerCase() + '@montague.lit';
spyOn(_converse.api, "trigger").and.callThrough();
// First check that the button does show
await mock.openChatBoxFor(_converse, contact_jid);
const view = _converse.chatboxviews.get(contact_jid);
const toolbar = view.querySelector('.chat-toolbar');
const call_button = toolbar.querySelector('converse-jingle-toolbar-button');
// Now check that the state changes
// toggleJingleCallStatus
const chatbox = view.model;
call_button.click();
expect(chatbox.get('jingle_status') === _converse.JINGLE_CALL_STATUS.PENDING);
call_button.click();
}));
});

0 comments on commit 4eb696e

Please sign in to comment.