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
fe34b7ea
Commit
fe34b7ea
authored
5 years ago
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix failing test
parent
37d052ad
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
spec/chatbox.js
spec/chatbox.js
+10
-7
No files found.
spec/chatbox.js
View file @
fe34b7ea
...
@@ -251,20 +251,23 @@
...
@@ -251,20 +251,23 @@
await
test_utils
.
waitForRoster
(
_converse
,
'
current
'
);
await
test_utils
.
waitForRoster
(
_converse
,
'
current
'
);
test_utils
.
openControlBox
();
test_utils
.
openControlBox
();
const
contact_jid
=
mock
.
cur_names
[
2
].
replace
(
/ /g
,
'
.
'
).
toLowerCase
()
+
'
@montague.lit
'
;
// openControlBox was called earlier, so the controlbox is
// visible, but no other chat boxes have been created.
expect
(
_converse
.
chatboxes
.
length
).
toEqual
(
1
);
expect
(
_converse
.
chatboxes
.
length
).
toEqual
(
1
);
const
contact_jid
=
mock
.
cur_names
[
2
].
replace
(
/ /g
,
'
.
'
).
toLowerCase
()
+
'
@montague.lit
'
;
const
view
=
await
test_utils
.
openChatBoxFor
(
_converse
,
contact_jid
);
const
view
=
await
test_utils
.
openChatBoxFor
(
_converse
,
contact_jid
);
const
el
=
sizzle
(
'
a.open-chat:contains("
'
+
view
.
model
.
getDisplayName
()
+
'
")
'
,
_converse
.
rosterview
.
el
).
pop
();
const
el
=
sizzle
(
'
a.open-chat:contains("
'
+
view
.
model
.
getDisplayName
()
+
'
")
'
,
_converse
.
rosterview
.
el
).
pop
();
await
u
.
waitUntil
(()
=>
u
.
isVisible
(
el
));
const
jid
=
el
.
textContent
.
replace
(
/ /g
,
'
.
'
).
toLowerCase
()
+
'
@montague.lit
'
;
const
jid
=
el
.
textContent
.
replace
(
/ /g
,
'
.
'
).
toLowerCase
()
+
'
@montague.lit
'
;
spyOn
(
_converse
.
api
,
"
trigger
"
).
and
.
callThrough
();
const
textarea
=
view
.
el
.
querySelector
(
'
.chat-textarea
'
);
await
u
.
waitUntil
(()
=>
u
.
isVisible
(
textarea
));
textarea
.
blur
();
spyOn
(
view
.
model
,
'
maybeShow
'
).
and
.
callThrough
();
spyOn
(
view
,
'
focus
'
).
and
.
callThrough
();
el
.
click
();
el
.
click
();
await
u
.
waitUntil
(()
=>
_converse
.
api
.
trigger
.
calls
.
count
(),
500
);
await
u
.
waitUntil
(()
=>
view
.
model
.
maybeShow
.
calls
.
count
(),
1000
);
expect
(
view
.
model
.
maybeShow
).
toHaveBeenCalled
();
expect
(
view
.
focus
).
toHaveBeenCalled
();
expect
(
_converse
.
chatboxes
.
length
).
toEqual
(
2
);
expect
(
_converse
.
chatboxes
.
length
).
toEqual
(
2
);
expect
(
_converse
.
api
.
trigger
).
toHaveBeenCalledWith
(
'
chatBoxFocused
'
,
jasmine
.
any
(
Object
),
jasmine
.
any
(
Object
));
done
();
done
();
}));
}));
...
...
This diff is collapsed.
Click to expand it.
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