Skip to content

Commit 4eb696e

Browse files
committed
additional tests for jingle
1 parent 97b737d commit 4eb696e

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

src/plugins/jingle/styles/jingle.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.conversejs {
2+
.chatbox {
3+
.chat-head {
4+
.button-color{
5+
color: var(--chat-head-text-color) !important;
6+
}
7+
}
8+
}
9+
}

src/plugins/jingle/tests/jingle.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/* global mock */
2+
3+
describe("A Call Button", function () {
4+
5+
it("has been shown in the toolbar",
6+
mock.initConverse(['chatBoxesFetched'], {}, async function (_converse) {
7+
8+
await mock.waitForRoster(_converse, 'current');
9+
await mock.openControlBox(_converse);
10+
const contact_jid = mock.cur_names[2].replace(/ /g,'.').toLowerCase() + '@montague.lit';
11+
spyOn(_converse.api, "trigger").and.callThrough();
12+
// First check that the button does show
13+
await mock.openChatBoxFor(_converse, contact_jid);
14+
const view = _converse.chatboxviews.get(contact_jid);
15+
const toolbar = view.querySelector('.chat-toolbar');
16+
const call_button = toolbar.querySelector('converse-jingle-toolbar-button');
17+
// Now check that the state changes
18+
// toggleJingleCallStatus
19+
const chatbox = view.model;
20+
call_button.click();
21+
expect(chatbox.get('jingle_status') === _converse.JINGLE_CALL_STATUS.PENDING);
22+
call_button.click();
23+
}));
24+
});

0 commit comments

Comments
 (0)