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
b35d71e2
Commit
b35d71e2
authored
May 14, 2013
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test chatroom message
parent
2a7031b5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
1 deletion
+21
-1
spec/ChatRoomSpec.js
spec/ChatRoomSpec.js
+21
-0
spec/MainSpec.js
spec/MainSpec.js
+0
-1
No files found.
spec/ChatRoomSpec.js
View file @
b35d71e2
...
...
@@ -11,6 +11,10 @@
var
chatroom_names
=
[
'
Dyon van de Wege
'
,
'
Thomas Kalb
'
,
'
Dirk Theissen
'
,
'
Felix Hofmann
'
,
'
Ka Lek
'
,
'
Anne Ebersbacher
'
];
closeChatRoom
=
function
(
name
)
{
converse
.
chatboxesview
.
views
[
'
lounge@muc.localhost
'
].
closeChat
();
};
describe
(
"
A Chat Room
"
,
$
.
proxy
(
function
()
{
beforeEach
(
$
.
proxy
(
function
()
{
if
(
!
$
(
"
div#controlbox
"
).
is
(
'
:visible
'
))
{
...
...
@@ -54,6 +58,23 @@
expect
(
$
(
occupant
).
attr
(
'
title
'
)).
toBe
(
'
This user is a moderator
'
);
},
converse
));
it
(
"
shows received and sent groupchat messages
"
,
$
.
proxy
(
function
()
{
var
view
=
this
.
chatboxesview
.
views
[
'
lounge@muc.localhost
'
];
if
(
!
view
.
$el
.
find
(
'
.chat-area
'
).
length
)
{
view
.
renderChatArea
();
}
var
nick
=
chatroom_names
[
0
];
var
text
=
'
This is a received message
'
;
var
message
=
$msg
({
from
:
'
lounge@muc.localhost/
'
+
nick
,
id
:
'
1
'
,
to
:
'
dummy@localhost
'
,
type
:
'
groupchat
'
}).
c
(
'
body
'
).
t
(
text
);
view
.
onChatRoomMessage
(
message
.
nodeTree
);
var
$chat_content
=
view
.
$el
.
find
(
'
.chat-content
'
);
expect
(
$chat_content
.
find
(
'
.chat-message
'
).
length
).
toBe
(
1
);
expect
(
$chat_content
.
find
(
'
.chat-message-content
'
).
text
()).
toBe
(
text
);
},
converse
));
it
(
"
can be saved to, and retrieved from, localStorage
"
,
$
.
proxy
(
function
()
{
// We instantiate a new ChatBoxes collection, which by default
// will be empty.
...
...
spec/MainSpec.js
View file @
b35d71e2
...
...
@@ -32,7 +32,6 @@
};
openControlBox
=
function
()
{
// Make sure the controlbox is open
if
(
!
$
(
"
div#controlbox
"
).
is
(
'
:visible
'
))
{
$
(
'
.toggle-online-users
'
).
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