-
-
Notifications
You must be signed in to change notification settings - Fork 777
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Don't show the bookmarked icon in the header. - Don't use the `name` from the bookmark, since Converse doesn't let you set the bookmark name and using it adds complexity. - While refreshing the disco, set the MUC name - Remove ability to add/remove bookmark from the rooms list
- Loading branch information
Showing
12 changed files
with
21 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,42 +26,6 @@ describe("A chat room", function () { | |
await u.waitUntil(() => room.getAndPersistNickname.calls.count()); | ||
expect(room.get('nick')).toBe('Othello'); | ||
})); | ||
|
||
it("displays that it's bookmarked through its bookmark icon", | ||
mock.initConverse([], {}, async function (_converse) { | ||
|
||
const { u } = converse.env; | ||
await mock.waitForRoster(_converse, 'current', 0); | ||
mock.waitUntilDiscoConfirmed( | ||
_converse, _converse.bare_jid, | ||
[{'category': 'pubsub', 'type': 'pep'}], | ||
[ | ||
'http://jabber.org/protocol/pubsub#publish-options', | ||
'urn:xmpp:bookmarks:1#compat' | ||
] | ||
); | ||
|
||
const nick = 'romeo'; | ||
const muc_jid = '[email protected]'; | ||
await _converse.api.rooms.open(muc_jid); | ||
await mock.getRoomFeatures(_converse, muc_jid); | ||
await mock.waitForReservedNick(_converse, muc_jid, nick); | ||
|
||
const view = _converse.chatboxviews.get('[email protected]'); | ||
expect(view.querySelector('.chatbox-title__text .fa-bookmark')).toBe(null); | ||
|
||
const { bookmarks } = _converse.state; | ||
bookmarks.create({ | ||
'jid': view.model.get('jid'), | ||
'autojoin': false, | ||
'name': 'The lounge', | ||
'nick': ' some1' | ||
}); | ||
view.model.set('bookmarked', true); | ||
await u.waitUntil(() => view.querySelector('.chatbox-title__text .fa-bookmark') !== null); | ||
view.model.set('bookmarked', false); | ||
await u.waitUntil(() => view.querySelector('.chatbox-title__text .fa-bookmark') === null); | ||
})); | ||
}); | ||
}); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ converse-muc-details-modal { | |
} | ||
strong { | ||
color: var(--muc-color); | ||
margin-right: 0.5em; | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -118,11 +118,11 @@ describe('Groupchats', () => { | |
let els = modal.querySelectorAll('p.room-info'); | ||
expect(els[0].textContent).toBe('Name: A Dark Cave'); | ||
|
||
expect(els[1].querySelector('strong').textContent).toBe('XMPP address'); | ||
expect(els[1].querySelector('strong').textContent).toBe('XMPP address:'); | ||
expect(els[1].querySelector('converse-texture').textContent.trim()).toBe( | ||
'xmpp:[email protected]?join' | ||
); | ||
expect(els[2].querySelector('strong').textContent).toBe('Description'); | ||
expect(els[2].querySelector('strong').textContent).toBe('Description:'); | ||
expect(els[2].querySelector('converse-texture').textContent).toBe('This is the description'); | ||
|
||
expect(els[3].textContent).toBe('Online users: 1'); | ||
|
@@ -153,13 +153,13 @@ describe('Groupchats', () => { | |
els = modal.querySelectorAll('p.room-info'); | ||
expect(els[0].textContent).toBe('Name: A Dark Cave'); | ||
|
||
expect(els[1].querySelector('strong').textContent).toBe('XMPP address'); | ||
expect(els[1].querySelector('strong').textContent).toBe('XMPP address:'); | ||
expect(els[1].querySelector('converse-texture').textContent.trim()).toBe( | ||
'xmpp:[email protected]?join' | ||
); | ||
expect(els[2].querySelector('strong').textContent).toBe('Description'); | ||
expect(els[2].querySelector('strong').textContent).toBe('Description:'); | ||
expect(els[2].querySelector('converse-texture').textContent).toBe('This is the description'); | ||
expect(els[3].querySelector('strong').textContent).toBe('Topic'); | ||
expect(els[3].querySelector('strong').textContent).toBe('Topic:'); | ||
await u.waitUntil( | ||
() => els[3].querySelector('converse-texture').textContent === 'Hatching dark plots' | ||
); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,65 +94,6 @@ describe("A list of open groupchats", function () { | |
expect(roomspanel.querySelectorAll('.available-room').length).toBe(1); | ||
await u.waitUntil(() => roomspanel.querySelectorAll('.msgs-indicator').length === 0); | ||
})); | ||
|
||
it("uses bookmarks to determine groupchat names", | ||
mock.initConverse( | ||
['chatBoxesFetched'], | ||
{'view_mode': 'fullscreen'}, | ||
async function (_converse) { | ||
|
||
const { Strophe, sizzle } = converse.env; | ||
const u = converse.env.utils; | ||
|
||
await mock.waitForRoster(_converse, 'current', 0); | ||
await mock.openAndEnterChatRoom(_converse, '[email protected]', 'romeo'); | ||
let stanza = stx`<presence to="[email protected]/orchard" from="[email protected]/newguy" xmlns="jabber:client"> | ||
<x xmlns="${Strophe.NS.MUC_USER}"> | ||
<item affiliation="none" jid="[email protected]/_converse.js-290929789" role="participant"/> | ||
</x> | ||
</presence>`; | ||
_converse.api.connection.get()._dataRecv(mock.createRequest(stanza)); | ||
|
||
spyOn(_converse.exports.Bookmarks.prototype, 'fetchBookmarks').and.callThrough(); | ||
|
||
await mock.waitUntilDiscoConfirmed( | ||
_converse, _converse.bare_jid, | ||
[{'category': 'pubsub', 'type':'pep'}], | ||
[`${Strophe.NS.PUBSUB}#publish-options`] | ||
); | ||
|
||
const IQ_stanzas = _converse.api.connection.get().IQ_stanzas; | ||
const sent_stanza = await u.waitUntil(() => IQ_stanzas.filter(s => sizzle('items[node="storage:bookmarks"]', s).length).pop()); | ||
expect(sent_stanza).toEqualStanza( | ||
stx`<iq from="[email protected]/orchard" id="${sent_stanza.getAttribute('id')}" type="get" xmlns="jabber:client"> | ||
<pubsub xmlns="http://jabber.org/protocol/pubsub"> | ||
<items node="storage:bookmarks"/> | ||
</pubsub> | ||
</iq>`); | ||
|
||
stanza = stx`<iq to="${_converse.api.connection.get().jid}" type="result" id="${sent_stanza.getAttribute('id')}" xmlns="jabber:client"> | ||
<pubsub xmlns="${Strophe.NS.PUBSUB}"> | ||
<items node="storage:bookmarks"> | ||
<item id="current"> | ||
<storage xmlns="storage:bookmarks"> | ||
<conference name="Bookmarked Lounge" jid="[email protected]"/> | ||
</storage> | ||
</item> | ||
</items> | ||
</pubsub> | ||
</iq>`; | ||
_converse.api.connection.get()._dataRecv(mock.createRequest(stanza)); | ||
|
||
await _converse.api.waitUntil('roomsListInitialized'); | ||
const controlbox = _converse.chatboxviews.get('controlbox'); | ||
const list = controlbox.querySelector('.list-container--openrooms'); | ||
expect(Array.from(list.classList).includes('hidden')).toBeFalsy(); | ||
const items = list.querySelectorAll('.list-item'); | ||
expect(items.length).toBe(1); | ||
|
||
await u.waitUntil(() => list.querySelector('.list-item .open-room span').textContent.trim() === 'Bookmarked Lounge'); | ||
expect(_converse.state.bookmarks.fetchBookmarks).toHaveBeenCalled(); | ||
})); | ||
}); | ||
|
||
describe("A groupchat shown in the groupchats list", function () { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters