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
0e81234f
Commit
0e81234f
authored
Jun 13, 2019
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix failing tests
parent
22bdccc7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
7 deletions
+15
-7
spec/controlbox.js
spec/controlbox.js
+14
-6
spec/smacks.js
spec/smacks.js
+1
-1
No files found.
spec/controlbox.js
View file @
0e81234f
...
...
@@ -141,11 +141,15 @@
await
test_utils
.
waitUntil
(()
=>
u
.
isVisible
(
modal
.
el
),
1000
);
const
view
=
_converse
.
xmppstatusview
;
spyOn
(
_converse
.
api
,
"
trigger
"
);
modal
.
el
.
querySelector
(
'
label[for="radio-busy"]
'
).
click
();
// Change status to "dnd"
modal
.
el
.
querySelector
(
'
[type="submit"]
'
).
click
();
expect
(
_converse
.
api
.
trigger
).
toHaveBeenCalledWith
(
'
statusChanged
'
,
'
dnd
'
);
const
last_stanza
=
_converse
.
connection
.
sent_stanzas
.
pop
();
expect
(
Strophe
.
serialize
(
last_stanza
)).
toBe
(
`<presence xmlns="jabber:client">`
+
`<show>dnd</show>`
+
`<priority>0</priority>`
+
`<c hash="sha-1" node="https://conversejs.org" ver="Hxbsr5fazs62i+O0GxIXf2OEDNs=" xmlns="http://jabber.org/protocol/caps"/>`
+
`</presence>`
);
const
first_child
=
view
.
el
.
querySelector
(
'
.xmpp-status span:first-child
'
);
expect
(
u
.
hasClass
(
'
online
'
,
first_child
)).
toBe
(
false
);
expect
(
u
.
hasClass
(
'
dnd
'
,
first_child
)).
toBe
(
true
);
...
...
@@ -166,13 +170,17 @@
await
test_utils
.
waitUntil
(()
=>
u
.
isVisible
(
modal
.
el
),
1000
);
const
view
=
_converse
.
xmppstatusview
;
spyOn
(
_converse
.
api
,
"
trigger
"
);
const
msg
=
'
I am happy
'
;
modal
.
el
.
querySelector
(
'
input[name="status_message"]
'
).
value
=
msg
;
modal
.
el
.
querySelector
(
'
[type="submit"]
'
).
click
();
const
last_stanza
=
_converse
.
connection
.
sent_stanzas
.
pop
();
expect
(
Strophe
.
serialize
(
last_stanza
)).
toBe
(
`<presence xmlns="jabber:client">`
+
`<status>I am happy</status>`
+
`<priority>0</priority>`
+
`<c hash="sha-1" node="https://conversejs.org" ver="Hxbsr5fazs62i+O0GxIXf2OEDNs=" xmlns="http://jabber.org/protocol/caps"/>`
+
`</presence>`
);
expect
(
_converse
.
api
.
trigger
).
toHaveBeenCalledWith
(
'
statusMessageChanged
'
,
msg
);
const
first_child
=
view
.
el
.
querySelector
(
'
.xmpp-status span:first-child
'
);
expect
(
u
.
hasClass
(
'
online
'
,
first_child
)).
toBe
(
true
);
expect
(
view
.
el
.
querySelector
(
'
.xmpp-status span:first-child
'
).
textContent
.
trim
()).
toBe
(
msg
);
...
...
spec/smacks.js
View file @
0e81234f
...
...
@@ -101,7 +101,7 @@
_converse
.
api
.
connection
.
reconnect
();
stanza
=
await
test_utils
.
waitUntil
(()
=>
sent_stanzas
.
filter
(
s
=>
(
s
.
tagName
===
'
resume
'
)).
pop
());
expect
(
Strophe
.
serialize
(
stanza
)).
toEqual
(
'
<resume h="
2
" previd="some-long-sm-id" xmlns="urn:xmpp:sm:3"/>
'
);
expect
(
Strophe
.
serialize
(
stanza
)).
toEqual
(
'
<resume h="
1
" previd="some-long-sm-id" xmlns="urn:xmpp:sm:3"/>
'
);
result
=
u
.
toStanza
(
`<resumed xmlns="urn:xmpp:sm:3" h="another-sequence-number" previd="some-long-sm-id"/>`
);
_converse
.
connection
.
_dataRecv
(
test_utils
.
createRequest
(
result
));
...
...
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