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
c023bd1d
Commit
c023bd1d
authored
Feb 01, 2019
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix test failures on Chrome 72
parent
9c28ef13
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
18 additions
and
12 deletions
+18
-12
.travis.yml
.travis.yml
+2
-2
Makefile
Makefile
+1
-1
spec/messages.js
spec/messages.js
+2
-2
spec/muc.js
spec/muc.js
+3
-3
spec/omemo.js
spec/omemo.js
+9
-4
spec/user-details-modal.js
spec/user-details-modal.js
+1
-0
No files found.
.travis.yml
View file @
c023bd1d
dist
:
trusty
dist
:
xenial
language
:
node_js
language
:
node_js
cache
:
cache
:
directories
:
directories
:
...
@@ -6,7 +6,7 @@ cache:
...
@@ -6,7 +6,7 @@ cache:
addons
:
addons
:
chrome
:
stable
chrome
:
stable
node_js
:
node_js
:
-
"
9
"
-
"
10
"
before_install
:
before_install
:
-
npm install -g lerna
-
npm install -g lerna
-
rm -rf ./node_modules
-
rm -rf ./node_modules
...
...
Makefile
View file @
c023bd1d
...
@@ -229,7 +229,7 @@ eslint: stamp-npm
...
@@ -229,7 +229,7 @@ eslint: stamp-npm
.PHONY
:
check
.PHONY
:
check
check
:
dist/converse.js eslint
check
:
dist/converse.js eslint
LOG_CR_VERBOSITY
=
INFO
$(CHROMIUM)
--no-sandbox
http://localhost:
$(HTTPSERVE_PORT)
/tests/index.html
LOG_CR_VERBOSITY
=
INFO
$(CHROMIUM)
--
disable-gpu
--
no-sandbox
http://localhost:
$(HTTPSERVE_PORT)
/tests/index.html
########################################################################
########################################################################
## Documentation
## Documentation
...
...
spec/messages.js
View file @
c023bd1d
...
@@ -2300,7 +2300,7 @@
...
@@ -2300,7 +2300,7 @@
expect
(
textarea
.
value
).
toBe
(
'
But soft, what light through yonder window breaks?
'
);
expect
(
textarea
.
value
).
toBe
(
'
But soft, what light through yonder window breaks?
'
);
expect
(
view
.
model
.
messages
.
at
(
0
).
get
(
'
correcting
'
)).
toBe
(
true
);
expect
(
view
.
model
.
messages
.
at
(
0
).
get
(
'
correcting
'
)).
toBe
(
true
);
expect
(
view
.
el
.
querySelectorAll
(
'
.chat-msg
'
).
length
).
toBe
(
2
);
expect
(
view
.
el
.
querySelectorAll
(
'
.chat-msg
'
).
length
).
toBe
(
2
);
await
u
.
hasClass
(
'
correcting
'
,
view
.
el
.
querySelector
(
'
.chat-msg
'
));
await
test_utils
.
waitUntil
(()
=>
u
.
hasClass
(
'
correcting
'
,
view
.
el
.
querySelector
(
'
.chat-msg
'
)
));
expect
(
textarea
.
value
).
toBe
(
'
But soft, what light through yonder window breaks?
'
);
expect
(
textarea
.
value
).
toBe
(
'
But soft, what light through yonder window breaks?
'
);
view
.
keyPressed
({
view
.
keyPressed
({
target
:
textarea
,
target
:
textarea
,
...
@@ -2309,7 +2309,7 @@
...
@@ -2309,7 +2309,7 @@
expect
(
textarea
.
value
).
toBe
(
''
);
expect
(
textarea
.
value
).
toBe
(
''
);
expect
(
view
.
model
.
messages
.
at
(
0
).
get
(
'
correcting
'
)).
toBe
(
false
);
expect
(
view
.
model
.
messages
.
at
(
0
).
get
(
'
correcting
'
)).
toBe
(
false
);
expect
(
view
.
el
.
querySelectorAll
(
'
.chat-msg
'
).
length
).
toBe
(
2
);
expect
(
view
.
el
.
querySelectorAll
(
'
.chat-msg
'
).
length
).
toBe
(
2
);
expect
(
u
.
hasClass
(
'
correcting
'
,
view
.
el
.
querySelector
(
'
.chat-msg
'
))).
toBe
(
false
);
await
test_utils
.
waitUntil
(()
=>
!
u
.
hasClass
(
'
correcting
'
,
view
.
el
.
querySelector
(
'
.chat-msg
'
))
);
done
();
done
();
}));
}));
...
...
spec/muc.js
View file @
c023bd1d
...
@@ -3951,7 +3951,7 @@
...
@@ -3951,7 +3951,7 @@
test_utils
.
openControlBox
();
test_utils
.
openControlBox
();
_converse
.
emit
(
'
rosterContactsFetched
'
);
_converse
.
emit
(
'
rosterContactsFetched
'
);
var
roomspanel
=
_converse
.
chatboxviews
.
get
(
'
controlbox
'
).
roomspanel
;
const
roomspanel
=
_converse
.
chatboxviews
.
get
(
'
controlbox
'
).
roomspanel
;
roomspanel
.
el
.
querySelector
(
'
.show-add-muc-modal
'
).
click
();
roomspanel
.
el
.
querySelector
(
'
.show-add-muc-modal
'
).
click
();
test_utils
.
closeControlBox
(
_converse
);
test_utils
.
closeControlBox
(
_converse
);
const
modal
=
roomspanel
.
add_room_modal
;
const
modal
=
roomspanel
.
add_room_modal
;
...
@@ -3960,8 +3960,8 @@
...
@@ -3960,8 +3960,8 @@
roomspanel
.
delegateEvents
();
// We need to rebind all events otherwise our spy won't be called
roomspanel
.
delegateEvents
();
// We need to rebind all events otherwise our spy won't be called
modal
.
el
.
querySelector
(
'
input[name="chatroom"]
'
).
value
=
'
lounce@muc.localhost
'
;
modal
.
el
.
querySelector
(
'
input[name="chatroom"]
'
).
value
=
'
lounce@muc.localhost
'
;
modal
.
el
.
querySelector
(
'
form input[type="submit"]
'
).
click
();
modal
.
el
.
querySelector
(
'
form input[type="submit"]
'
).
click
();
await
test_utils
.
waitUntil
(()
=>
_converse
.
chatboxes
.
length
);
await
test_utils
.
waitUntil
(()
=>
_converse
.
chatboxes
.
length
);
expect
(
sizzle
(
'
.chatroom
'
,
_converse
.
el
).
filter
(
u
.
isVisible
).
length
).
toBe
(
1
);
// There should now be an open chatroom
await
test_utils
.
waitUntil
(()
=>
sizzle
(
'
.chatroom
'
,
_converse
.
el
).
filter
(
u
.
isVisible
).
length
===
1
);
done
();
done
();
}));
}));
...
...
spec/omemo.js
View file @
c023bd1d
...
@@ -5,11 +5,13 @@
...
@@ -5,11 +5,13 @@
const
u
=
converse
.
env
.
utils
;
const
u
=
converse
.
env
.
utils
;
function
deviceListFetched
(
_converse
,
jid
)
{
async
function
deviceListFetched
(
_converse
,
jid
)
{
return
_
.
filter
(
const
stanza
=
await
test_utils
.
waitUntil
(()
=>
_
.
filter
(
_converse
.
connection
.
IQ_stanzas
,
_converse
.
connection
.
IQ_stanzas
,
iq
=>
iq
.
nodeTree
.
querySelector
(
`iq[to="
${
jid
}
"] items[node="eu.siacs.conversations.axolotl.devicelist"]`
)
iq
=>
iq
.
nodeTree
.
querySelector
(
`iq[to="
${
jid
}
"] items[node="eu.siacs.conversations.axolotl.devicelist"]`
)
).
pop
();
).
pop
());
await
test_utils
.
waitUntil
(()
=>
_converse
.
devicelists
.
get
(
jid
));
return
stanza
;
}
}
function
ownDeviceHasBeenPublished
(
_converse
)
{
function
ownDeviceHasBeenPublished
(
_converse
)
{
...
@@ -115,7 +117,7 @@
...
@@ -115,7 +117,7 @@
_converse
.
connection
.
_dataRecv
(
test_utils
.
createRequest
(
stanza
));
_converse
.
connection
.
_dataRecv
(
test_utils
.
createRequest
(
stanza
));
await
test_utils
.
waitUntil
(()
=>
_converse
.
omemo_store
);
await
test_utils
.
waitUntil
(()
=>
_converse
.
omemo_store
);
const
devicelist
=
_converse
.
devicelists
.
get
({
'
jid
'
:
contact_jid
});
const
devicelist
=
_converse
.
devicelists
.
get
({
'
jid
'
:
contact_jid
});
expect
(
devicelist
.
devices
.
length
).
toBe
(
1
);
await
test_utils
.
waitUntil
(()
=>
devicelist
.
devices
.
length
===
1
);
const
view
=
_converse
.
chatboxviews
.
get
(
contact_jid
);
const
view
=
_converse
.
chatboxviews
.
get
(
contact_jid
);
view
.
model
.
set
(
'
omemo_active
'
,
true
);
view
.
model
.
set
(
'
omemo_active
'
,
true
);
...
@@ -291,6 +293,7 @@
...
@@ -291,6 +293,7 @@
await
test_utils
.
waitUntil
(()
=>
_converse
.
omemo_store
);
await
test_utils
.
waitUntil
(()
=>
_converse
.
omemo_store
);
expect
(
_converse
.
devicelists
.
length
).
toBe
(
2
);
expect
(
_converse
.
devicelists
.
length
).
toBe
(
2
);
await
test_utils
.
waitUntil
(()
=>
deviceListFetched
(
_converse
,
contact_jid
));
const
devicelist
=
_converse
.
devicelists
.
get
(
contact_jid
);
const
devicelist
=
_converse
.
devicelists
.
get
(
contact_jid
);
expect
(
devicelist
.
devices
.
length
).
toBe
(
1
);
expect
(
devicelist
.
devices
.
length
).
toBe
(
1
);
expect
(
devicelist
.
devices
.
at
(
0
).
get
(
'
id
'
)).
toBe
(
'
4e30f35051b7b8b42abe083742187228
'
);
expect
(
devicelist
.
devices
.
at
(
0
).
get
(
'
id
'
)).
toBe
(
'
4e30f35051b7b8b42abe083742187228
'
);
...
@@ -444,6 +447,7 @@
...
@@ -444,6 +447,7 @@
expect
(
_converse
.
devicelists
.
length
).
toBe
(
2
);
expect
(
_converse
.
devicelists
.
length
).
toBe
(
2
);
const
devicelist
=
_converse
.
devicelists
.
get
(
contact_jid
);
const
devicelist
=
_converse
.
devicelists
.
get
(
contact_jid
);
await
test_utils
.
waitUntil
(()
=>
deviceListFetched
(
_converse
,
contact_jid
));
expect
(
devicelist
.
devices
.
length
).
toBe
(
1
);
expect
(
devicelist
.
devices
.
length
).
toBe
(
1
);
expect
(
devicelist
.
devices
.
at
(
0
).
get
(
'
id
'
)).
toBe
(
'
4e30f35051b7b8b42abe083742187228
'
);
expect
(
devicelist
.
devices
.
at
(
0
).
get
(
'
id
'
)).
toBe
(
'
4e30f35051b7b8b42abe083742187228
'
);
...
@@ -1239,6 +1243,7 @@
...
@@ -1239,6 +1243,7 @@
await
test_utils
.
waitUntil
(()
=>
_converse
.
omemo_store
);
await
test_utils
.
waitUntil
(()
=>
_converse
.
omemo_store
);
expect
(
_converse
.
devicelists
.
length
).
toBe
(
2
);
expect
(
_converse
.
devicelists
.
length
).
toBe
(
2
);
await
test_utils
.
waitUntil
(()
=>
deviceListFetched
(
_converse
,
contact_jid
));
const
devicelist
=
_converse
.
devicelists
.
get
(
contact_jid
);
const
devicelist
=
_converse
.
devicelists
.
get
(
contact_jid
);
expect
(
devicelist
.
devices
.
length
).
toBe
(
2
);
expect
(
devicelist
.
devices
.
length
).
toBe
(
2
);
expect
(
devicelist
.
devices
.
at
(
0
).
get
(
'
id
'
)).
toBe
(
'
4e30f35051b7b8b42abe083742187228
'
);
expect
(
devicelist
.
devices
.
at
(
0
).
get
(
'
id
'
)).
toBe
(
'
4e30f35051b7b8b42abe083742187228
'
);
...
...
spec/user-details-modal.js
View file @
c023bd1d
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
test_utils
.
openChatBoxFor
(
_converse
,
contact_jid
);
test_utils
.
openChatBoxFor
(
_converse
,
contact_jid
);
await
test_utils
.
waitUntil
(()
=>
_converse
.
chatboxes
.
length
);
await
test_utils
.
waitUntil
(()
=>
_converse
.
chatboxes
.
length
);
const
view
=
_converse
.
chatboxviews
.
get
(
contact_jid
);
const
view
=
_converse
.
chatboxviews
.
get
(
contact_jid
);
await
new
Promise
((
resolve
)
=>
view
.
model
.
once
(
'
contactAdded
'
,
resolve
));
let
show_modal_button
=
view
.
el
.
querySelector
(
'
.show-user-details-modal
'
);
let
show_modal_button
=
view
.
el
.
querySelector
(
'
.show-user-details-modal
'
);
expect
(
u
.
isVisible
(
show_modal_button
)).
toBeTruthy
();
expect
(
u
.
isVisible
(
show_modal_button
)).
toBeTruthy
();
show_modal_button
.
click
();
show_modal_button
.
click
();
...
...
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