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
373b235d
Commit
373b235d
authored
Sep 13, 2013
by
JC Brand
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into 0.6.x
parents
367803d6
be662847
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
1 deletion
+27
-1
CHANGES.rst
CHANGES.rst
+1
-0
spec/MainSpec.js
spec/MainSpec.js
+26
-1
No files found.
CHANGES.rst
View file @
373b235d
...
@@ -7,6 +7,7 @@ Changelog
...
@@ -7,6 +7,7 @@ Changelog
- Add icon for the unavailable chat state. [jcbrand]
- Add icon for the unavailable chat state. [jcbrand]
- Chat state descriptions weren't translation aware. [jcbrand]
- Chat state descriptions weren't translation aware. [jcbrand]
- Clear messages from localStorage when user types "/clear". [jcbrand]
- Clear messages from localStorage when user types "/clear". [jcbrand]
- The 'xa' chat state wasn't being handled properly. [jcbrand]
0.6.3 (2013-09-12)
0.6.3 (2013-09-12)
------------------
------------------
...
...
spec/MainSpec.js
View file @
373b235d
...
@@ -580,7 +580,7 @@
...
@@ -580,7 +580,7 @@
var
view
=
this
.
chatboxesview
.
views
[
contact_jid
];
var
view
=
this
.
chatboxesview
.
views
[
contact_jid
];
var
message
=
'
This message is sent from this chatbox
'
;
var
message
=
'
This message is sent from this chatbox
'
;
spyOn
(
view
,
'
sendMessage
'
).
andCallThrough
();
spyOn
(
view
,
'
sendMessage
'
).
andCallThrough
();
view
.
$el
.
find
(
'
.chat-textarea
'
).
text
(
message
);
view
.
$el
.
find
(
'
.chat-textarea
'
).
val
(
message
).
text
(
message
);
view
.
$el
.
find
(
'
textarea.chat-textarea
'
).
trigger
(
$
.
Event
(
'
keypress
'
,
{
keyCode
:
13
}));
view
.
$el
.
find
(
'
textarea.chat-textarea
'
).
trigger
(
$
.
Event
(
'
keypress
'
,
{
keyCode
:
13
}));
expect
(
view
.
sendMessage
).
toHaveBeenCalled
();
expect
(
view
.
sendMessage
).
toHaveBeenCalled
();
expect
(
view
.
model
.
messages
.
length
,
2
);
expect
(
view
.
model
.
messages
.
length
,
2
);
...
@@ -588,8 +588,33 @@
...
@@ -588,8 +588,33 @@
expect
(
txt
).
toEqual
(
message
);
expect
(
txt
).
toEqual
(
message
);
},
converse
));
},
converse
));
},
converse
));
},
converse
));
describe
(
"
Special Messages
"
,
$
.
proxy
(
function
()
{
it
(
"
'/clear' can be used to clear messages in a conversation
"
,
$
.
proxy
(
function
()
{
var
contact_jid
=
cur_names
[
0
].
replace
(
'
'
,
'
.
'
).
toLowerCase
()
+
'
@localhost
'
;
var
view
=
this
.
chatboxesview
.
views
[
contact_jid
];
var
message
=
'
This message is another sent from this chatbox
'
;
// Lets make sure there is at least one message already
// (e.g for when this test is run on its own).
view
.
$el
.
find
(
'
.chat-textarea
'
).
val
(
message
).
text
(
message
);
view
.
$el
.
find
(
'
textarea.chat-textarea
'
).
trigger
(
$
.
Event
(
'
keypress
'
,
{
keyCode
:
13
}));
expect
(
view
.
model
.
messages
.
length
>
0
).
toBeTruthy
();
expect
(
view
.
model
.
messages
.
localStorage
.
records
.
length
>
0
).
toBeTruthy
();
message
=
'
/clear
'
;
var
old_length
=
view
.
model
.
messages
.
length
;
spyOn
(
view
,
'
sendMessage
'
).
andCallThrough
();
view
.
$el
.
find
(
'
.chat-textarea
'
).
val
(
message
).
text
(
message
);
view
.
$el
.
find
(
'
textarea.chat-textarea
'
).
trigger
(
$
.
Event
(
'
keypress
'
,
{
keyCode
:
13
}));
expect
(
view
.
sendMessage
).
toHaveBeenCalled
();
expect
(
view
.
model
.
messages
.
length
,
0
);
// The messages must be removed from the modal
expect
(
view
.
model
.
messages
.
localStorage
.
records
.
length
,
0
);
// And also from localStorage
},
converse
));
},
converse
));
},
converse
));
},
converse
));
describe
(
"
A Message Counter
"
,
$
.
proxy
(
function
()
{
describe
(
"
A Message Counter
"
,
$
.
proxy
(
function
()
{
beforeEach
(
$
.
proxy
(
function
()
{
beforeEach
(
$
.
proxy
(
function
()
{
converse
.
clearMsgCounter
();
converse
.
clearMsgCounter
();
...
...
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