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
ed86b22f
Commit
ed86b22f
authored
Apr 13, 2013
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a new test
Check that a chatbox is created when a roster item is clicked.
parent
7b2dbf9b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
8 deletions
+21
-8
spec/RosterSpec.js
spec/RosterSpec.js
+20
-7
tests_main.js
tests_main.js
+1
-1
No files found.
spec/RosterSpec.js
View file @
ed86b22f
...
...
@@ -7,7 +7,7 @@
);
}
(
this
,
function
(
xmppchat
)
{
return
describe
(
"
Roster
"
,
$
.
proxy
(
function
()
{
return
describe
(
"
Converse.js
"
,
$
.
proxy
(
function
()
{
// Names from http://www.fakenamegenerator.com/
names
=
[
'
Louw Spekman
'
,
'
Mohamad Stet
'
,
'
Dominik Beyer
'
,
'
Dirk Eichel
'
,
'
Marco Duerr
'
,
'
Ute Schiffer
'
,
...
...
@@ -42,7 +42,7 @@
this
.
rosterview
=
new
this
.
RosterView
({
'
model
'
:
this
.
roster
});
this
.
rosterview
.
render
();
describe
(
"
t
he contacts roster
"
,
$
.
proxy
(
function
()
{
describe
(
"
T
he contacts roster
"
,
$
.
proxy
(
function
()
{
// by default the dts are hidden from css class and only later they will be hidden
// by jQuery therefore for the first check we will see if visible instead of none
...
...
@@ -160,7 +160,7 @@
},
xmppchat
));
it
(
"
can change their status to online and be sorted alphabetically
"
,
$
.
proxy
(
function
()
{
var
item
,
view
,
jid
;
var
item
,
view
,
jid
,
t
;
spyOn
(
this
.
rosterview
,
'
render
'
).
andCallThrough
();
for
(
i
=
59
;
i
>
54
;
i
--
)
{
jid
=
names
[
i
].
replace
(
'
'
,
'
.
'
).
toLowerCase
()
+
'
@localhost
'
;
...
...
@@ -178,7 +178,7 @@
},
xmppchat
));
it
(
"
can change their status to busy and be sorted alphabetically
"
,
$
.
proxy
(
function
()
{
var
item
,
view
,
jid
;
var
item
,
view
,
jid
,
t
;
spyOn
(
this
.
rosterview
,
'
render
'
).
andCallThrough
();
for
(
i
=
54
;
i
>
49
;
i
--
)
{
jid
=
names
[
i
].
replace
(
'
'
,
'
.
'
).
toLowerCase
()
+
'
@localhost
'
;
...
...
@@ -195,7 +195,7 @@
},
xmppchat
));
it
(
"
can change their status to away and be sorted alphabetically
"
,
$
.
proxy
(
function
()
{
var
item
,
view
,
jid
;
var
item
,
view
,
jid
,
t
;
spyOn
(
this
.
rosterview
,
'
render
'
).
andCallThrough
();
for
(
i
=
49
;
i
>
44
;
i
--
)
{
jid
=
names
[
i
].
replace
(
'
'
,
'
.
'
).
toLowerCase
()
+
'
@localhost
'
;
...
...
@@ -213,7 +213,7 @@
},
xmppchat
));
it
(
"
can change their status to unavailable and be sorted alphabetically
"
,
$
.
proxy
(
function
()
{
var
item
,
view
,
jid
;
var
item
,
view
,
jid
,
t
;
spyOn
(
this
.
rosterview
,
'
render
'
).
andCallThrough
();
for
(
i
=
44
;
i
>
39
;
i
--
)
{
jid
=
names
[
i
].
replace
(
'
'
,
'
.
'
).
toLowerCase
()
+
'
@localhost
'
;
...
...
@@ -255,8 +255,21 @@
}
},
xmppchat
));
},
xmppchat
));
},
xmppchat
));
describe
(
"
Chatboxes
"
,
$
.
proxy
(
function
()
{
it
(
"
are created when you click on a roster item
"
,
$
.
proxy
(
function
()
{
var
$el
=
$
(
this
.
rosterview
.
$el
.
find
(
'
dt#xmpp-contacts
'
).
siblings
(
'
dd.current-xmpp-contact.online
'
).
find
(
'
a.open-chat
'
)[
0
]);
var
click
=
jQuery
.
Event
(
"
click
"
,
{
target
:
$el
});
var
jid
=
$el
.
text
().
replace
(
'
'
,
'
.
'
).
toLowerCase
()
+
'
@localhost
'
;
var
view
=
this
.
rosterview
.
rosteritemviews
[
jid
];
spyOn
(
view
,
'
openChat
'
);
// We need to rebind all events otherwise our spy won't work.
view
.
delegateEvents
();
var
ev
=
$el
.
click
();
expect
(
view
.
openChat
).
toHaveBeenCalled
();
},
xmppchat
));
},
xmppchat
));
},
xmppchat
));
}));
tests_main.js
View file @
ed86b22f
require
([
"
jquery
"
,
"
spec/
Roster
Spec
"
],
function
(
$
)
{
require
([
"
jquery
"
,
"
spec/
Main
Spec
"
],
function
(
$
)
{
$
(
function
(
$
)
{
var
jasmineEnv
=
jasmine
.
getEnv
();
...
...
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