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
dfb130fb
Commit
dfb130fb
authored
Sep 06, 2014
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test that user is properly informed when kicked out of a room
parent
9e5dc21a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
2 deletions
+41
-2
spec/chatroom.js
spec/chatroom.js
+41
-2
No files found.
spec/chatroom.js
View file @
dfb130fb
...
...
@@ -202,7 +202,7 @@
.
c
(
'
status
'
).
attrs
({
code
:
'
110
'
}).
nodeTree
;
var
view
=
this
.
chatboxviews
.
get
(
'
lounge@localhost
'
);
view
.
onChatRoomPresence
(
presence
,
{
'
nick
'
:
'
lounge
'
});
view
.
onChatRoomPresence
(
presence
,
{
nick
:
'
oldnick
'
,
name
:
'
lounge@localhost
'
});
var
$chat_content
=
view
.
$el
.
find
(
'
.chat-content
'
);
expect
(
$chat_content
.
find
(
'
div.chat-info
'
).
length
).
toBe
(
1
);
expect
(
$chat_content
.
find
(
'
div.chat-info
'
).
html
()).
toBe
(
'
Your nickname has been changed to: <strong>newnick</strong>
'
);
...
...
@@ -220,11 +220,50 @@
role
:
'
participant
'
}).
up
()
.
c
(
'
status
'
).
attrs
({
code
:
'
110
'
}).
nodeTree
;
view
.
onChatRoomPresence
(
presence
,
{
'
nick
'
:
'
lounge
'
});
view
.
onChatRoomPresence
(
presence
,
{
nick
:
'
newnick
'
,
name
:
'
lounge@localhost
'
});
expect
(
$chat_content
.
find
(
'
div.chat-info
'
).
length
).
toBe
(
1
);
expect
(
$chat_content
.
find
(
'
div.chat-info
'
).
html
()).
toBe
(
'
Your nickname has been changed to: <strong>newnick</strong>
'
);
},
converse
));
it
(
"
informs users if they have been kicked out of the chat room
"
,
$
.
proxy
(
function
()
{
/* <presence
* from='harfleur@chat.shakespeare.lit/pistol'
* to='pistol@shakespeare.lit/harfleur'
* type='unavailable'>
* <x xmlns='http://jabber.org/protocol/muc#user'>
* <item affiliation='none' role='none'>
* <actor nick='Fluellen'/>
* <reason>Avaunt, you cullion!</reason>
* </item>
* <status code='307'/>
* </x>
* </presence>
*/
test_utils
.
openChatRoom
(
'
lounge
'
,
'
localhost
'
,
'
dummy
'
);
var
presence
=
$pres
().
attrs
({
from
:
'
lounge@localhost/dummy
'
,
to
:
'
dummy@localhost/pda
'
,
type
:
'
unavailable
'
})
.
c
(
'
x
'
).
attrs
({
xmlns
:
'
http://jabber.org/protocol/muc#user
'
})
.
c
(
'
item
'
).
attrs
({
affiliation
:
'
none
'
,
jid
:
'
dummy@localhost/pda
'
,
role
:
'
none
'
})
.
c
(
'
actor
'
).
attrs
({
nick
:
'
Fluellen
'
}).
up
()
.
c
(
'
reason
'
).
t
(
'
Avaunt, you cullion!
'
).
up
()
.
up
()
.
c
(
'
status
'
).
attrs
({
code
:
'
307
'
}).
nodeTree
;
var
view
=
this
.
chatboxviews
.
get
(
'
lounge@localhost
'
);
view
.
onChatRoomPresence
(
presence
,
{
nick
:
'
dummy
'
,
name
:
'
lounge@localhost
'
});
var
$chat_content
=
view
.
$el
.
find
(
'
.chat-content
'
);
expect
(
$chat_content
.
length
).
toBe
(
0
);
// There shouldn't be a chat content area anymore
var
$chat_body
=
view
.
$el
.
find
(
'
.chat-body
'
);
expect
(
$chat_body
.
html
()).
toBe
(
'
<p>You have been kicked from this room</p><p>The reason given is: "Avaunt, you cullion!"</p>
'
);
},
converse
));
it
(
"
can be saved to, and retrieved from, browserStorage
"
,
$
.
proxy
(
function
()
{
test_utils
.
openChatRoom
(
'
lounge
'
,
'
localhost
'
,
'
dummy
'
);
// We instantiate a new ChatBoxes collection, which by default
...
...
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