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
1cfbe0cc
Commit
1cfbe0cc
authored
Apr 16, 2013
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add more tests for chat messages
parent
c70e80c5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
2 deletions
+28
-2
spec/MainSpec.js
spec/MainSpec.js
+28
-2
No files found.
spec/MainSpec.js
View file @
1cfbe0cc
...
...
@@ -44,6 +44,9 @@
'
get
'
:
function
()
{},
'
subscribe
'
:
function
()
{},
'
registerCallback
'
:
function
()
{}
},
'
vcard
'
:
{
'
get
'
:
function
()
{}
}
};
...
...
@@ -366,9 +369,9 @@
},
xmppchat
));
},
xmppchat
));
describe
(
"
Chatboxes
"
,
$
.
proxy
(
function
()
{
describe
(
"
A Chatbox
"
,
$
.
proxy
(
function
()
{
it
(
"
are
created when you click on a roster item
"
,
$
.
proxy
(
function
()
{
it
(
"
is
created when you click on a roster item
"
,
$
.
proxy
(
function
()
{
var
i
,
$el
,
click
,
jid
,
view
;
// showControlBox was called earlier, so the controlbox is
// visible, but no other chat boxes have been created.
...
...
@@ -430,6 +433,29 @@
this
.
chatboxes
.
onConnected
();
expect
(
this
.
chatboxes
.
length
).
toEqual
(
0
);
},
xmppchat
));
describe
(
"
A Chat Message
"
,
$
.
proxy
(
function
()
{
it
(
"
received from a contact will open a chatbox and appear inside it
"
,
$
.
proxy
(
function
()
{
var
sender_jid
=
cur_names
[
0
].
replace
(
'
'
,
'
.
'
).
toLowerCase
()
+
'
@localhost
'
;
var
timestamp
=
(
new
Date
()).
getTime
(),
msg
=
$msg
({
from
:
sender_jid
,
to
:
this
.
bare_jid
,
type
:
'
chat
'
,
id
:
timestamp
}).
c
(
'
body
'
).
t
(
'
This is a received message
'
).
up
()
.
c
(
'
active
'
,
{
'
xmlns
'
:
'
http://jabber.org/protocol/chatstates
'
}).
tree
();
var
chatbox
=
this
.
chatboxesview
.
views
[
sender_jid
].
model
;
spyOn
(
chatbox
,
'
messageReceived
'
);
this
.
chatboxes
.
messageReceived
(
msg
);
expect
(
chatbox
.
messageReceived
).
toHaveBeenCalled
();
},
xmppchat
));
it
(
"
can be sent from a chatbox, and will appear inside it
"
,
$
.
proxy
(
function
()
{
var
hello
;
},
xmppchat
));
},
xmppchat
));
},
xmppchat
));
},
xmppchat
));
...
...
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