Commit 6e86fe33 authored by JC Brand's avatar JC Brand

Fixes #1913. Can't connect to non-ascii JID

parent 09371712
/* global mock */
/* global mock, converse */
describe("Converse", function() {
......@@ -277,7 +277,7 @@ describe("Converse", function() {
// Test for one JID
chat = await _converse.api.chats.open(jid);
expect(chat instanceof Object).toBeTruthy();
expect(chat.get('box_id')).toBe(`box-${btoa(jid)}`);
expect(chat.get('box_id')).toBe(`box-${jid}`);
const view = _converse.chatboxviews.get(jid);
await u.waitUntil(() => u.isVisible(view.el));
......@@ -286,8 +286,8 @@ describe("Converse", function() {
await u.waitUntil(() => _converse.chatboxes.length == 3);
const list = await _converse.api.chats.get([jid, jid2]);
expect(Array.isArray(list)).toBeTruthy();
expect(list[0].get('box_id')).toBe(`box-${btoa(jid)}`);
expect(list[1].get('box_id')).toBe(`box-${btoa(jid2)}`);
expect(list[0].get('box_id')).toBe(`box-${jid}`);
expect(list[1].get('box_id')).toBe(`box-${jid2}`);
done();
}));
......@@ -307,7 +307,7 @@ describe("Converse", function() {
chat = await _converse.api.chats.open(jid);
expect(chat instanceof Object).toBeTruthy();
expect(chat.get('box_id')).toBe(`box-${btoa(jid)}`);
expect(chat.get('box_id')).toBe(`box-${jid}`);
expect(
Object.keys(chat),
['close', 'endOTR', 'focus', 'get', 'initiateOTR', 'is_chatroom', 'maximize', 'minimize', 'open', 'set']
......@@ -317,8 +317,8 @@ describe("Converse", function() {
// Test for multiple JIDs
const list = await _converse.api.chats.open([jid, jid2]);
expect(Array.isArray(list)).toBeTruthy();
expect(list[0].get('box_id')).toBe(`box-${btoa(jid)}`);
expect(list[1].get('box_id')).toBe(`box-${btoa(jid2)}`);
expect(list[0].get('box_id')).toBe(`box-${jid}`);
expect(list[1].get('box_id')).toBe(`box-${jid2}`);
done();
}));
});
......@@ -353,7 +353,7 @@ describe("Converse", function() {
expect(_converse.api.settings.get('emoji_categories')?.food).toBe(undefined);
done();
}));
it("only overrides the passed in properties",
mock.initConverse([],
{
......
......@@ -330,7 +330,7 @@ converse.plugins.add('converse-chat', {
// but we're in embedded mode.
return;
}
this.set({'box_id': `box-${btoa(jid)}`});
this.set({'box_id': `box-${jid}`});
this.initNotifications();
this.initMessages();
......
......@@ -66,7 +66,7 @@ converse.plugins.add('converse-headlines', {
initialize () {
this.initMessages();
this.set({'box_id': `box-${btoa(this.get('jid'))}`});
this.set({'box_id': `box-${this.get('jid')}`});
/**
* Triggered once a {@link _converse.HeadlinesBox} has been created and initialized.
* @event _converse#headlinesBoxInitialized
......
......@@ -384,7 +384,7 @@ converse.plugins.add('converse-muc', {
async initialize () {
this.initialized = u.getResolveablePromise();
this.debouncedRejoin = debounce(this.rejoin, 250);
this.set('box_id', `box-${btoa(this.get('jid'))}`);
this.set('box_id', `box-${this.get('jid')}`);
this.initNotifications();
this.initMessages();
this.initOccupants();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment