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
77734d5f
Commit
77734d5f
authored
May 23, 2019
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve test to also check stanza traffic
parent
b8765008
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
spec/roster.js
spec/roster.js
+11
-3
No files found.
spec/roster.js
View file @
77734d5f
...
...
@@ -613,18 +613,26 @@
fullname
:
name
});
spyOn
(
window
,
'
confirm
'
).
and
.
returnValue
(
true
);
spyOn
(
_converse
.
connection
,
'
sendIQ
'
).
and
.
callFake
(
function
(
iq
,
callback
)
{
if
(
typeof
callback
===
"
function
"
)
{
return
callback
();
}
});
await
test_utils
.
waitUntil
(()
=>
{
const
el
=
_converse
.
rosterview
.
get
(
'
Pending contacts
'
).
el
;
return
u
.
isVisible
(
el
)
&&
_
.
filter
(
el
.
querySelectorAll
(
'
li
'
),
li
=>
u
.
isVisible
(
li
)).
length
;
},
700
)
spyOn
(
_converse
.
connection
,
'
sendIQ
'
).
and
.
callThrough
();
sizzle
(
`.remove-xmpp-contact[title="Click to remove
${
name
}
as a contact"]`
,
_converse
.
rosterview
.
el
).
pop
().
click
();
expect
(
window
.
confirm
).
toHaveBeenCalled
();
expect
(
_converse
.
connection
.
sendIQ
).
toHaveBeenCalled
();
const
iq
=
_converse
.
connection
.
IQ_stanzas
.
pop
();
expect
(
Strophe
.
serialize
(
iq
)).
toBe
(
`<iq id="
${
iq
.
getAttribute
(
'
id
'
)}
" type="set" xmlns="jabber:client">`
+
`<query xmlns="jabber:iq:roster">`
+
`<item jid="suleyman.van.beusichem@localhost" subscription="remove"/>`
+
`</query>`
+
`</iq>`
);
const
stanza
=
u
.
toStanza
(
`<iq id="
${
iq
.
getAttribute
(
'
id
'
)}
" to="dummy@localhost/resource" type="result"/>`
);
_converse
.
connection
.
_dataRecv
(
test_utils
.
createRequest
(
stanza
));
await
test_utils
.
waitUntil
(()
=>
!
u
.
isVisible
(
_converse
.
rosterview
.
get
(
'
Pending contacts
'
).
el
));
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