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
087718d7
Commit
087718d7
authored
Jul 13, 2015
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expand a test case to also check for received archived messages.
updates #306
parent
1a9771c7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
0 deletions
+42
-0
spec/mam.js
spec/mam.js
+42
-0
No files found.
spec/mam.js
View file @
087718d7
...
...
@@ -327,6 +327,45 @@
converse
.
connection
.
_dataRecv
(
test_utils
.
createRequest
(
stanza
));
expect
(
converse
.
onMAMQueryResult
).
toHaveBeenCalled
();
/* <message id='aeb213' to='juliet@capulet.lit/chamber'>
* <result xmlns='urn:xmpp:mam:0' queryid='f27' id='28482-98726-73623'>
* <forwarded xmlns='urn:xmpp:forward:0'>
* <delay xmlns='urn:xmpp:delay' stamp='2010-07-10T23:08:25Z'/>
* <message
* to='juliet@capulet.lit/balcony'
* from='romeo@montague.lit/orchard'
* type='chat'
* xmlns='jabber:client'>
* <body>Call me but love, and I'll be new baptized; Henceforth I never will be Romeo.</body>
* </message>
* </forwarded>
* </result>
* </message>
*/
var
msg1
=
$msg
({
'
id
'
:
'
aeb213
'
,
'
to
'
:
'
juliet@capulet.lit/chamber
'
})
.
c
(
'
result
'
,
{
'
xmlns
'
:
'
urn:xmpp:mam:0
'
,
'
queryid
'
:
queryid
,
'
id
'
:
'
28482-98726-73623
'
})
.
c
(
'
forwarded
'
,
{
'
xmlns
'
:
'
urn:xmpp:forward:0
'
})
.
c
(
'
delay
'
,
{
'
xmlns
'
:
'
urn:xmpp:delay
'
,
'
stamp
'
:
'
2010-07-10T23:08:25Z
'
}).
up
()
.
c
(
'
message
'
,
{
'
xmlns
'
:
'
jabber:client
'
,
'
to
'
:
'
juliet@capulet.lit/balcony
'
,
'
from
'
:
'
romeo@montague.lit/orchard
'
,
'
type
'
:
'
chat
'
})
.
c
(
'
body
'
).
t
(
"
Call me but love, and I'll be new baptized;
"
);
converse
.
connection
.
_dataRecv
(
test_utils
.
createRequest
(
msg1
));
var
msg2
=
$msg
({
'
id
'
:
'
aeb213
'
,
'
to
'
:
'
juliet@capulet.lit/chamber
'
})
.
c
(
'
result
'
,
{
'
xmlns
'
:
'
urn:xmpp:mam:0
'
,
'
queryid
'
:
queryid
,
'
id
'
:
'
28482-98726-73624
'
})
.
c
(
'
forwarded
'
,
{
'
xmlns
'
:
'
urn:xmpp:forward:0
'
})
.
c
(
'
delay
'
,
{
'
xmlns
'
:
'
urn:xmpp:delay
'
,
'
stamp
'
:
'
2010-07-10T23:08:25Z
'
}).
up
()
.
c
(
'
message
'
,
{
'
xmlns
'
:
'
jabber:client
'
,
'
to
'
:
'
juliet@capulet.lit/balcony
'
,
'
from
'
:
'
romeo@montague.lit/orchard
'
,
'
type
'
:
'
chat
'
})
.
c
(
'
body
'
).
t
(
"
Henceforth I never will be Romeo.
"
);
converse
.
connection
.
_dataRecv
(
test_utils
.
createRequest
(
msg2
));
/* Send a <fin> message to indicate the end of the result set.
*
* <message>
...
...
@@ -348,6 +387,9 @@
expect
(
callback
).
toHaveBeenCalled
();
var
args
=
callback
.
argsForCall
[
0
];
expect
(
args
[
0
].
length
).
toBe
(
2
);
expect
(
args
[
0
][
0
].
outerHTML
).
toBe
(
msg1
.
nodeTree
.
outerHTML
);
expect
(
args
[
0
][
1
].
outerHTML
).
toBe
(
msg2
.
nodeTree
.
outerHTML
);
expect
(
args
[
1
][
'
with
'
]).
toBe
(
'
romeo@capulet.lit
'
);
expect
(
args
[
1
].
max
).
toBe
(
'
10
'
);
expect
(
args
[
1
].
count
).
toBe
(
'
16
'
);
...
...
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