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
e630339a
Commit
e630339a
authored
Mar 02, 2018
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update spec to test sent out stanza as well
parent
1e5b6243
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3953 additions
and
5 deletions
+3953
-5
package-lock.json
package-lock.json
+3931
-0
package.json
package.json
+3
-1
spec/chatroom.js
spec/chatroom.js
+19
-4
No files found.
package-lock.json
View file @
e630339a
This source diff could not be displayed because it is too large. You can
view the blob
instead.
package.json
View file @
e630339a
...
...
@@ -76,5 +76,7 @@
"
wait-until-promise
"
:
"
^1.0.0
"
,
"
xss
"
:
"
^0.3.3
"
},
"dependencies"
:
{}
"dependencies"
:
{
"
npm
"
:
"
^5.7.1
"
}
}
spec/chatroom.js
View file @
e630339a
...
...
@@ -3142,26 +3142,41 @@
null
,
[
'
rosterGroupsFetched
'
],
{},
function
(
done
,
_converse
)
{
var
sendIQ
=
_converse
.
connection
.
sendIQ
;
var
sent_stanza
,
IQ_id
;
spyOn
(
_converse
.
connection
,
'
sendIQ
'
).
and
.
callFake
(
function
(
iq
,
callback
,
errback
)
{
sent_stanza
=
iq
;
IQ_id
=
sendIQ
.
bind
(
this
)(
iq
,
callback
,
errback
);
});
test_utils
.
openControlBox
();
var
panel
=
_converse
.
chatboxviews
.
get
(
'
controlbox
'
).
roomspanel
;
$
(
panel
.
tabs
).
find
(
'
li
'
).
last
().
find
(
'
a
'
)[
0
].
click
();
// Click the chatrooms tab
panel
.
model
.
set
({
'
muc_domain
'
:
'
muc.localhost
'
});
// Make sure the domain is set
// See: http://xmpp.org/extensions/xep-0045.html#disco-rooms
expect
(
$
(
'
#available-chatrooms
'
).
children
(
'
dt
'
).
length
).
toBe
(
0
);
expect
(
$
(
'
#available-chatrooms
'
).
children
(
'
dd
'
).
length
).
toBe
(
0
);
expect
(
document
.
querySelectorAll
(
'
#available-chatrooms dt
'
).
length
).
toBe
(
0
);
expect
(
document
.
querySelectorAll
(
'
#available-chatrooms dd
'
).
length
).
toBe
(
0
);
document
.
querySelector
(
'
input#show-rooms
'
).
click
();
expect
(
sent_stanza
.
toLocaleString
()).
toBe
(
"
<iq to='muc.localhost' from='dummy@localhost/resource' type='get' xmlns='jabber:client' id='
"
+
IQ_id
+
"
'>
"
+
"
<query xmlns='http://jabber.org/protocol/disco#items'/>
"
+
"
</iq>
"
);
var
iq
=
$iq
({
from
:
'
muc.localhost
'
,
to
:
'
dummy@localhost/pda
'
,
id
:
IQ_id
,
type
:
'
result
'
}).
c
(
'
query
'
)
.
c
(
'
item
'
,
{
jid
:
'
heath@chat.shakespeare.lit
'
,
name
:
'
A Lonely Heath
'
}).
up
()
.
c
(
'
item
'
,
{
jid
:
'
coven@chat.shakespeare.lit
'
,
name
:
'
A Dark Cave
'
}).
up
()
.
c
(
'
item
'
,
{
jid
:
'
forres@chat.shakespeare.lit
'
,
name
:
'
The Palace
'
}).
up
()
.
c
(
'
item
'
,
{
jid
:
'
inverness@chat.shakespeare.lit
'
,
name
:
'
Macbeth's Castle
'
}).
nodeTree
;
_converse
.
connection
.
_dataRecv
(
test_utils
.
createRequest
(
iq
));
panel
.
onRoomsFound
(
iq
);
expect
(
$
(
panel
.
el
.
querySelector
(
'
#available-chatrooms
'
)).
children
(
'
dt
'
).
length
).
toBe
(
1
);
expect
(
document
.
querySelectorAll
(
'
#available-chatrooms dt
'
).
length
).
toBe
(
1
);
expect
(
$
(
panel
.
el
.
querySelector
(
'
#available-chatrooms
'
)).
children
(
'
dt
'
).
first
().
text
()).
toBe
(
"
Rooms found
"
);
expect
(
$
(
panel
.
el
.
querySelector
(
'
#available-chatrooms
'
)).
children
(
'
dd
'
).
length
).
toBe
(
4
);
done
();
...
...
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