Commit f0a680e4 authored by JC Brand's avatar JC Brand

Remove `animate` config settings.

Also update tests
parent 04af3eb0
...@@ -219,13 +219,6 @@ Support for `XEP-0077: In band registration <https://xmpp.org/extensions/xep-007 ...@@ -219,13 +219,6 @@ Support for `XEP-0077: In band registration <https://xmpp.org/extensions/xep-007
Allow XMPP account registration showing the corresponding UI register form interface. Allow XMPP account registration showing the corresponding UI register form interface.
animate
-------
* Default: ``true``
Show animations, for example when opening and closing chatboxes.
archived_messages_page_size archived_messages_page_size
--------------------------- ---------------------------
......
...@@ -123,25 +123,17 @@ ...@@ -123,25 +123,17 @@
const filter = _converse.rosterview.el.querySelector('.roster-filter'); const filter = _converse.rosterview.el.querySelector('.roster-filter');
const names = mock.cur_names; const names = mock.cur_names;
test_utils.openControlBox(); test_utils.openControlBox();
_converse.rosterview.update(); // XXX: Will normally called as event handler
expect(_.isNull(filter)).toBe(false); expect(_.isNull(filter)).toBe(false);
await test_utils.waitUntil(() => !u.isVisible(filter)); test_utils.createContacts(_converse, 'current').openControlBox();
for (let i=0; i<names.length; i++) {
_converse.roster.create({ const view = _converse.chatboxviews.get('controlbox');
ask: null, const flyout = view.el.querySelector('.box-flyout');
fullname: names[i], const panel = flyout.querySelector('.controlbox-pane');
jid: names[i].replace(/ /g,'.').toLowerCase() + '@localhost',
requesting: 'false',
subscription: 'both'
});
_converse.rosterview.update(); // XXX: Will normally called as event handler
}
function hasScrollBar (el) { function hasScrollBar (el) {
return el.isConnected && el.parentElement.offsetHeight < el.scrollHeight; return el.isConnected && flyout.offsetHeight < panel.scrollHeight;
} }
await test_utils.waitUntil( const el = _converse.rosterview.roster_el;
() => hasScrollBar(_converse.rosterview.roster_el) ? u.isVisible(filter) : !u.isVisible(filter) await test_utils.waitUntil(() => hasScrollBar(el) ? u.isVisible(filter) : !u.isVisible(filter), 900);
);
done(); done();
})); }));
...@@ -321,25 +313,25 @@ ...@@ -321,25 +313,25 @@
jid = mock.cur_names[4].replace(/ /g,'.').toLowerCase() + '@localhost'; jid = mock.cur_names[4].replace(/ /g,'.').toLowerCase() + '@localhost';
_converse.roster.get(jid).presence.set('show', 'dnd'); _converse.roster.get(jid).presence.set('show', 'dnd');
test_utils.openControlBox(); test_utils.openControlBox();
const button = _converse.rosterview.el.querySelector('span[data-type="state"]'); const button = _converse.rosterview.el.querySelector('span[data-type="state"]');
button.click(); button.click();
const roster = _converse.rosterview.roster_el; const roster = _converse.rosterview.roster_el;
await test_utils.waitUntil(() => sizzle('li', roster).filter(u.isVisible).length === 15, 500); await test_utils.waitUntil(() => sizzle('li', roster).filter(u.isVisible).length === 15, 900);
console.log('First await')
const filter = _converse.rosterview.el.querySelector('.state-type'); const filter = _converse.rosterview.el.querySelector('.state-type');
expect(sizzle('ul.roster-group-contacts', roster).filter(u.isVisible).length).toBe(5); expect(sizzle('ul.roster-group-contacts', roster).filter(u.isVisible).length).toBe(5);
filter.value = "online"; filter.value = "online";
u.triggerEvent(filter, 'change'); u.triggerEvent(filter, 'change');
await test_utils.waitUntil(() => sizzle('li', roster).filter(u.isVisible).length === 1, 500); await test_utils.waitUntil(() => sizzle('li', roster).filter(u.isVisible).length === 1, 900);
expect(sizzle('li', roster).filter(u.isVisible).pop().textContent.trim()).toBe('Rinse Sommer'); expect(sizzle('li', roster).filter(u.isVisible).pop().textContent.trim()).toBe('Rinse Sommer');
await test_utils.waitUntil(() => sizzle('ul.roster-group-contacts', roster).filter(u.isVisible).length === 1, 500); await test_utils.waitUntil(() => sizzle('ul.roster-group-contacts', roster).filter(u.isVisible).length === 1, 900);
console.log('Second await')
const ul = sizzle('ul.roster-group-contacts', roster).filter(u.isVisible).pop(); const ul = sizzle('ul.roster-group-contacts', roster).filter(u.isVisible).pop();
expect(ul.parentElement.firstElementChild.textContent.trim()).toBe('friends & acquaintences'); expect(ul.parentElement.firstElementChild.textContent.trim()).toBe('friends & acquaintences');
filter.value = "dnd"; filter.value = "dnd";
u.triggerEvent(filter, 'change'); u.triggerEvent(filter, 'change');
await test_utils.waitUntil(() => sizzle('li', roster).filter(u.isVisible).pop().textContent.trim() === 'Annegreet Gomez', 900); await test_utils.waitUntil(() => sizzle('li', roster).filter(u.isVisible).pop().textContent.trim() === 'Annegreet Gomez', 900);
console.log('Third await')
expect(sizzle('ul.roster-group-contacts', roster).filter(u.isVisible).length).toBe(1); expect(sizzle('ul.roster-group-contacts', roster).filter(u.isVisible).length).toBe(1);
done(); done();
})); }));
......
...@@ -867,13 +867,13 @@ converse.plugins.add('converse-rosterview', { ...@@ -867,13 +867,13 @@ converse.plugins.add('converse-rosterview', {
} }
}, 100), }, 100),
update: _.debounce(function () { update () {
if (!u.isVisible(this.roster_el)) { if (!u.isVisible(this.roster_el)) {
u.showElement(this.roster_el); u.showElement(this.roster_el);
} }
this.filter_view.showOrHide(); this.filter_view.showOrHide();
return this; return this;
}, _converse.animate ? 100 : 0), },
filter (query, type) { filter (query, type) {
// First we make sure the filter is restored to its // First we make sure the filter is restored to its
......
...@@ -188,7 +188,6 @@ _converse.CONTROLBOX_TYPE = 'controlbox'; ...@@ -188,7 +188,6 @@ _converse.CONTROLBOX_TYPE = 'controlbox';
// ---------------------------- // ----------------------------
_converse.default_settings = { _converse.default_settings = {
allow_non_roster_messaging: false, allow_non_roster_messaging: false,
animate: true,
authentication: 'login', // Available values are "login", "prebind", "anonymous" and "external". authentication: 'login', // Available values are "login", "prebind", "anonymous" and "external".
auto_away: 0, // Seconds after which user status is set to 'away' auto_away: 0, // Seconds after which user status is set to 'away'
auto_login: false, // Currently only used in connection with anonymous login auto_login: false, // Currently only used in connection with anonymous login
......
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