Skip to content

Commit 97b737d

Browse files
committed
jingle: added the tests for jingle & styled the header button
1 parent 309c29d commit 97b737d

File tree

7 files changed

+9
-5
lines changed

7 files changed

+9
-5
lines changed

karma.conf.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ module.exports = function(config) {
6464
{ pattern: "src/plugins/controlbox/tests/controlbox.js", type: 'module' },
6565
{ pattern: "src/plugins/controlbox/tests/login.js", type: 'module' },
6666
{ pattern: "src/plugins/headlines-view/tests/headline.js", type: 'module' },
67+
{ pattern: "src/plugins/jingle/tests/jingle.js", type: 'module' },
6768
{ pattern: "src/plugins/mam-views/tests/mam.js", type: 'module' },
6869
{ pattern: "src/plugins/mam-views/tests/placeholder.js", type: 'module' },
6970
{ pattern: "src/plugins/minimize/tests/minchats.js", type: 'module' },

src/plugins/chatview/templates/chat-head.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export default (o) => {
4141
<div class="chatbox-title__text" title="${o.jid}">
4242
${ (o.type !== _converse.HEADLINES_TYPE) ? html`<a class="user show-msg-author-modal" @click=${o.showUserDetailsModal}>${ display_name }</a>` : display_name }
4343
</div>
44-
<converse-call-notification class="d-flex flex-row-reverse justify-content-center chatbox-call-status" jid=${o.model.get('jid')}></converse-call-notification>
44+
<converse-call-notification class="d-flex flex-row-reverse justify-content-center chatbox-call-status chatbox-title__text" jid=${o.model.get('jid')}></converse-call-notification>
4545
</div>
4646
<div class="chatbox-title__buttons row no-gutters">
4747
${ until(tpl_dropdown_btns(), '') }

src/plugins/chatview/tests/chatbox.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,8 @@ describe("Chatboxes", function () {
296296
}));
297297

298298

299-
it("can contain a button for starting a call",
300-
mock.initConverse(['chatBoxesFetched'], {}, async function (_converse) {
299+
fit("can contain a button for starting a call",
300+
mock.initConverse(['chatBoxesFetched'], { blacklisted_plugins: ['converse-jingle']}, async function (_converse) {
301301

302302
const { api } = _converse;
303303
await mock.waitForRoster(_converse, 'current');

src/plugins/jingle/chat-header-notification.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { _converse, api } from "@converse/headless/core";
33
import tpl_header_button from "./templates/header-button.js";
44
import { JINGLE_CALL_STATUS } from "./constants.js";
55

6+
import './styles/jingle.scss';
7+
68
export default class CallNotification extends CustomElement {
79

810
static get properties() {

src/plugins/jingle/constants.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
export const JINGLE_CALL_STATUS = {
32
PENDING: 0,
43
ACTIVE: 1,

src/plugins/jingle/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { _converse, converse } from '@converse/headless/core.js';
88
import 'plugins/modal/index.js';
99
import "./chat-header-notification.js";
1010
import './toolbar-button.js';
11+
import { JINGLE_CALL_STATUS } from './constants.js';
1112
import { html } from "lit";
1213

1314

@@ -28,6 +29,7 @@ converse.plugins.add('converse-jingle', {
2829
/* The initialize function gets called as soon as the plugin is
2930
* loaded by converse.js's plugin machinery.
3031
*/
32+
_converse.JINGLE_CALL_STATUS = JINGLE_CALL_STATUS;
3133
_converse.api.listen.on('getToolbarButtons', (toolbar_el, buttons) => {
3234
if (!this.is_groupchat) {
3335
buttons.push(html`

src/plugins/jingle/templates/header-button.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const tpl_active_call = (o) => {
66
const button = __('Call Inititated');
77
return html`
88
<div>
9-
<span><button @click=${ o.endCall }>${ button }</button></span>
9+
<span><a class="button-color" @click=${ o.endCall }>${ button }</a></span>
1010
</div>
1111
`;
1212
}

0 commit comments

Comments
 (0)