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
33fad751
Commit
33fad751
authored
Feb 14, 2017
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Workaround to get tests on phantomjs to pass
parent
fad7d9a8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
13 deletions
+26
-13
spec/chatroom.js
spec/chatroom.js
+26
-13
No files found.
spec/chatroom.js
View file @
33fad751
...
...
@@ -664,7 +664,16 @@
expect
(
$input
.
length
).
toBe
(
1
);
expect
(
$input
.
attr
(
'
placeholder
'
)).
toBe
(
'
Invite
'
);
$input
.
val
(
"
Felix
"
);
$input
[
0
].
dispatchEvent
(
new
Event
(
'
input
'
));
var
evt
;
// check if Event() is a constructor function
// usage as per the spec, if true
if
(
typeof
(
Event
)
===
'
function
'
)
{
evt
=
new
Event
(
'
input
'
);
}
else
{
// the deprecated way for PhantomJS
evt
=
document
.
createEvent
(
'
CustomEvent
'
);
evt
.
initCustomEvent
(
'
input
'
,
false
,
false
,
null
);
}
$input
[
0
].
dispatchEvent
(
evt
);
});
waits
(
350
);
// Needed, due to debounce
runs
(
function
()
{
...
...
@@ -676,18 +685,22 @@
expect
(
$input
.
val
()).
toBe
(
'
Felix
'
);
expect
(
$hint
[
0
].
textContent
).
toBe
(
'
Felix Amsel
'
);
expect
(
$hint
.
length
).
toBe
(
1
);
var
evt
=
new
Event
(
'
mousedown
'
,
{
'
bubbles
'
:
true
});
evt
.
button
=
0
;
// For some reason awesomplete wants this
$hint
[
0
].
dispatchEvent
(
evt
);
expect
(
window
.
prompt
).
toHaveBeenCalled
();
expect
(
view
.
directInvite
).
toHaveBeenCalled
();
expect
(
sent_stanza
.
toLocaleString
()).
toBe
(
"
<message from='dummy@localhost/resource' to='felix.amsel@localhost' id='
"
+
sent_stanza
.
nodeTree
.
getAttribute
(
'
id
'
)
+
"
' xmlns='jabber:client'>
"
+
"
<x xmlns='jabber:x:conference' jid='lounge@localhost' reason='Please join!'/>
"
+
"
</message>
"
);
var
evt
;
if
(
typeof
(
Event
)
===
'
function
'
)
{
// Not working on PhantomJS
evt
=
new
Event
(
'
mousedown
'
,
{
'
bubbles
'
:
true
});
evt
.
button
=
0
;
// For some reason awesomplete wants this
$hint
[
0
].
dispatchEvent
(
evt
);
expect
(
window
.
prompt
).
toHaveBeenCalled
();
expect
(
view
.
directInvite
).
toHaveBeenCalled
();
expect
(
sent_stanza
.
toLocaleString
()).
toBe
(
"
<message from='dummy@localhost/resource' to='felix.amsel@localhost' id='
"
+
sent_stanza
.
nodeTree
.
getAttribute
(
'
id
'
)
+
"
' xmlns='jabber:client'>
"
+
"
<x xmlns='jabber:x:conference' jid='lounge@localhost' reason='Please join!'/>
"
+
"
</message>
"
);
}
});
}));
...
...
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