Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
55e32c73
Commit
55e32c73
authored
Oct 27, 2014
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tests
parent
7e4c1d6d
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
423 additions
and
300 deletions
+423
-300
converse.js
converse.js
+2
-1
spec/chatbox.js
spec/chatbox.js
+32
-21
spec/controlbox.js
spec/controlbox.js
+385
-274
spec/profiling.js
spec/profiling.js
+2
-2
src/templates/roster.html
src/templates/roster.html
+2
-2
No files found.
converse.js
View file @
55e32c73
...
...
@@ -3874,7 +3874,7 @@
}
console
.
log
(
'
update called
'
);
return
this
.
showHideFilter
();
},
10
0
),
},
converse
.
animate
?
100
:
0
),
render
:
function
()
{
this
.
$el
.
html
(
converse
.
templates
.
roster
({
...
...
@@ -4010,6 +4010,7 @@
reset
:
function
()
{
converse
.
roster
.
reset
();
this
.
removeAll
();
this
.
$roster
=
$
(
'
<dl class="roster-contacts" style="display: none;"></dl>
'
);
this
.
render
().
update
();
return
this
;
},
...
...
spec/chatbox.js
View file @
55e32c73
...
...
@@ -57,23 +57,26 @@
expect
(
$
(
"
#conversejs .chatbox
"
).
length
).
toBe
(
1
);
// Controlbox is open
// Test that they can be trimmed
var
online_contacts
=
this
.
rosterview
.
$el
.
find
(
'
dt.roster-group
'
).
siblings
(
'
dd.current-xmpp-contact
'
).
find
(
'
a.open-chat
'
);
for
(
i
=
0
;
i
<
online_contacts
.
length
;
i
++
)
{
$el
=
$
(
online_contacts
[
i
]);
jid
=
$el
.
text
().
replace
(
/ /g
,
'
.
'
).
toLowerCase
()
+
'
@localhost
'
;
$el
.
click
();
expect
(
this
.
chatboxviews
.
trimChats
).
toHaveBeenCalled
();
chatboxview
=
this
.
chatboxviews
.
get
(
jid
);
spyOn
(
chatboxview
,
'
hide
'
).
andCallThrough
();
chatboxview
.
model
.
set
({
'
minimized
'
:
true
});
expect
(
trimmed_chatboxes
.
addChat
).
toHaveBeenCalled
();
expect
(
chatboxview
.
hide
).
toHaveBeenCalled
();
trimmedview
=
trimmed_chatboxes
.
get
(
jid
);
}
// Test that they can be maximized again
runs
(
$
.
proxy
(
function
()
{
converse
.
rosterview
.
update
();
// XXX: Hack to make sure $roster element is attaced.
},
this
));
waits
(
50
);
runs
(
$
.
proxy
(
function
()
{
// Test that they can be maximized again
var
online_contacts
=
this
.
rosterview
.
$el
.
find
(
'
dt.roster-group
'
).
siblings
(
'
dd.current-xmpp-contact
'
).
find
(
'
a.open-chat
'
);
for
(
i
=
0
;
i
<
online_contacts
.
length
;
i
++
)
{
$el
=
$
(
online_contacts
[
i
]);
jid
=
$el
.
text
().
replace
(
/ /g
,
'
.
'
).
toLowerCase
()
+
'
@localhost
'
;
$el
.
click
();
expect
(
this
.
chatboxviews
.
trimChats
).
toHaveBeenCalled
();
chatboxview
=
this
.
chatboxviews
.
get
(
jid
);
spyOn
(
chatboxview
,
'
hide
'
).
andCallThrough
();
chatboxview
.
model
.
set
({
'
minimized
'
:
true
});
expect
(
trimmed_chatboxes
.
addChat
).
toHaveBeenCalled
();
expect
(
chatboxview
.
hide
).
toHaveBeenCalled
();
trimmedview
=
trimmed_chatboxes
.
get
(
jid
);
}
var
key
=
this
.
chatboxviews
.
keys
()[
1
];
trimmedview
=
trimmed_chatboxes
.
get
(
key
);
chatbox
=
trimmedview
.
model
;
...
...
@@ -99,11 +102,19 @@
chatbox
=
test_utils
.
openChatBoxFor
(
contact_jid
);
chatboxview
=
this
.
chatboxviews
.
get
(
contact_jid
);
spyOn
(
chatboxview
,
'
focus
'
);
$el
=
this
.
rosterview
.
$el
.
find
(
'
a.open-chat:contains("
'
+
chatbox
.
get
(
'
fullname
'
)
+
'
")
'
);
jid
=
$el
.
text
().
replace
(
/ /g
,
'
.
'
).
toLowerCase
()
+
'
@localhost
'
;
$el
.
click
();
expect
(
this
.
chatboxes
.
length
).
toEqual
(
2
);
expect
(
chatboxview
.
focus
).
toHaveBeenCalled
();
// Test that they can be trimmed
runs
(
$
.
proxy
(
function
()
{
converse
.
rosterview
.
update
();
// XXX: Hack to make sure $roster element is attaced.
},
this
));
waits
(
50
);
runs
(
$
.
proxy
(
function
()
{
$el
=
this
.
rosterview
.
$el
.
find
(
'
a.open-chat:contains("
'
+
chatbox
.
get
(
'
fullname
'
)
+
'
")
'
);
jid
=
$el
.
text
().
replace
(
/ /g
,
'
.
'
).
toLowerCase
()
+
'
@localhost
'
;
$el
.
click
();
expect
(
this
.
chatboxes
.
length
).
toEqual
(
2
);
expect
(
chatboxview
.
focus
).
toHaveBeenCalled
();
},
this
));
},
converse
));
it
(
"
can be saved to, and retrieved from, browserStorage
"
,
$
.
proxy
(
function
()
{
...
...
spec/controlbox.js
View file @
55e32c73
This diff is collapsed.
Click to expand it.
spec/profiling.js
View file @
55e32c73
...
...
@@ -14,7 +14,7 @@
converse
.
connection
.
_changeConnectStatus
(
Strophe
.
Status
.
CONNECTED
);
});
it
(
"
adds hundreds of contacts to the roster
"
,
$
.
proxy
(
function
()
{
x
it
(
"
adds hundreds of contacts to the roster
"
,
$
.
proxy
(
function
()
{
converse
.
roster_groups
=
false
;
spyOn
(
this
.
roster
,
'
clearCache
'
).
andCallThrough
();
expect
(
this
.
roster
.
pluck
(
'
jid
'
).
length
).
toBe
(
0
);
...
...
@@ -39,7 +39,7 @@
expect
(
this
.
roster
.
pluck
(
'
jid
'
).
length
).
toBe
(
400
);
},
converse
));
it
(
"
adds hundreds of contacts to the roster, with roster groups
"
,
$
.
proxy
(
function
()
{
x
it
(
"
adds hundreds of contacts to the roster, with roster groups
"
,
$
.
proxy
(
function
()
{
// converse.show_only_online_users = true;
converse
.
roster_groups
=
true
;
spyOn
(
this
.
roster
,
'
clearCache
'
).
andCallThrough
();
...
...
src/templates/roster.html
View file @
55e32c73
<input
class=
"roster-filter"
placeholder=
"{{placeholder}}"
>
<select
class=
"filter-type"
>
<input
style=
"display: none;"
class=
"roster-filter"
placeholder=
"{{placeholder}}"
>
<select
style=
"display: none;"
class=
"filter-type"
>
<option
value=
"contacts"
>
{{label_contacts}}
</option>
<option
value=
"groups"
>
{{label_groups}}
</option>
</select>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment