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
18565e79
Commit
18565e79
authored
Jul 25, 2013
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove trailing whitespace
parent
1c95e473
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
21 deletions
+21
-21
mock.js
mock.js
+7
-7
spec/MainSpec.js
spec/MainSpec.js
+14
-14
No files found.
mock.js
View file @
18565e79
(
function
(
root
,
factory
)
{
define
(
"
mock
"
,
[
'
converse
'
],
function
()
{
return
factory
();
define
(
"
mock
"
,
[
'
converse
'
],
function
()
{
return
factory
();
});
}(
this
,
function
(
converse
)
{
var
mock_connection
=
{
...
...
@@ -14,7 +14,7 @@
'
rooms
'
:
{}
},
'
jid
'
:
'
dummy@localhost
'
,
'
addHandler
'
:
function
(
handler
,
ns
,
name
,
type
,
id
,
from
,
options
)
{
'
addHandler
'
:
function
(
handler
,
ns
,
name
,
type
,
id
,
from
,
options
)
{
return
function
()
{};
},
'
send
'
:
function
()
{},
...
...
@@ -26,7 +26,7 @@
'
subscribe
'
:
function
()
{},
'
registerCallback
'
:
function
()
{}
},
'
vcard
'
:
{
'
vcard
'
:
{
'
get
'
:
function
(
callback
,
jid
)
{
var
firstname
,
lastname
;
if
(
!
jid
)
{
...
...
@@ -41,7 +41,7 @@
var
fullname
=
firstname
+
'
'
+
lastname
;
var
vcard
=
$iq
().
c
(
'
vCard
'
).
c
(
'
FN
'
).
t
(
fullname
);
callback
(
vcard
.
tree
());
}
}
},
'
disco
'
:
{
'
info
'
:
function
()
{},
...
...
spec/MainSpec.js
View file @
18565e79
...
...
@@ -54,7 +54,7 @@
expect
(
$
(
"
div#controlbox
"
).
is
(
'
:visible
'
)).
toBe
(
true
);
},
converse
);
it
(
"
can be opened by clicking a DOM element with class 'toggle-online-users'
"
,
open_controlbox
);
describe
(
"
The Status Widget
"
,
$
.
proxy
(
function
()
{
it
(
"
can be used to set the current user's chat status
"
,
$
.
proxy
(
function
()
{
var
view
=
this
.
xmppstatusview
;
...
...
@@ -121,7 +121,7 @@
var
i
,
t
,
is_last
;
spyOn
(
this
.
rosterview
,
'
render
'
).
andCallThrough
();
for
(
i
=
0
;
i
<
pend_names
.
length
;
i
++
)
{
is_last
=
i
==
(
pend_names
.
length
-
1
);
is_last
=
i
==
=
(
pend_names
.
length
-
1
);
this
.
roster
.
create
({
jid
:
pend_names
[
i
].
replace
(
'
'
,
'
.
'
).
toLowerCase
()
+
'
@localhost
'
,
subscription
:
'
none
'
,
...
...
@@ -129,7 +129,7 @@
fullname
:
pend_names
[
i
],
is_last
:
is_last
});
// For performance reasons, the roster should only be shown once
// For performance reasons, the roster should only be shown once
// the last contact has been added.
if
(
is_last
)
{
expect
(
this
.
rosterview
.
$el
.
is
(
'
:visible
'
)).
toEqual
(
true
);
...
...
@@ -162,7 +162,7 @@
subscription
:
'
both
'
,
ask
:
null
,
fullname
:
cur_names
[
i
],
is_last
:
i
==
(
cur_names
.
length
-
1
)
is_last
:
i
==
=
(
cur_names
.
length
-
1
)
});
expect
(
this
.
rosterview
.
render
).
toHaveBeenCalled
();
// Check that they are sorted alphabetically
...
...
@@ -291,7 +291,7 @@
subscription
:
'
none
'
,
ask
:
'
request
'
,
fullname
:
req_names
[
i
],
is_last
:
i
==
(
req_names
.
length
-
1
)
is_last
:
i
==
=
(
req_names
.
length
-
1
)
});
expect
(
this
.
rosterview
.
render
).
toHaveBeenCalled
();
// Check that they are sorted alphabetically
...
...
@@ -335,7 +335,7 @@
expect
(
this
.
rosterview
.
removeRosterItem
).
toHaveBeenCalled
();
expect
(
this
.
connection
.
roster
.
unauthorize
).
toHaveBeenCalled
();
// There should now be one less contact
expect
(
this
.
roster
.
length
).
toEqual
(
num_contacts
-
1
);
expect
(
this
.
roster
.
length
).
toEqual
(
num_contacts
-
1
);
},
converse
));
},
converse
));
...
...
@@ -368,7 +368,7 @@
afterEach
(
$
.
proxy
(
function
()
{
// Contacts retrieved from localStorage have chat_status of
// "offline".
// "offline".
// In the next test suite, we need some online contacts, so
// we make some online now
for
(
i
=
0
;
i
<
5
;
i
++
)
{
...
...
@@ -456,7 +456,7 @@
expect
(
newchatboxes
.
length
).
toEqual
(
0
);
// Lets open the controlbox again, purely for visual feedback
open_controlbox
();
open_controlbox
();
},
converse
));
describe
(
"
A Chat Message
"
,
$
.
proxy
(
function
()
{
...
...
@@ -465,8 +465,8 @@
var
sender_jid
=
cur_names
[
0
].
replace
(
'
'
,
'
.
'
).
toLowerCase
()
+
'
@localhost
'
;
msg
=
$msg
({
from
:
sender_jid
,
to
:
this
.
connection
.
jid
,
type
:
'
chat
'
,
to
:
this
.
connection
.
jid
,
type
:
'
chat
'
,
id
:
(
new
Date
()).
getTime
()
}).
c
(
'
body
'
).
t
(
message
).
up
()
.
c
(
'
active
'
,
{
'
xmlns
'
:
'
http://jabber.org/protocol/chatstates
'
}).
tree
();
...
...
@@ -534,8 +534,8 @@
var
sender_jid
=
cur_names
[
0
].
replace
(
'
'
,
'
.
'
).
toLowerCase
()
+
'
@localhost
'
;
msg
=
$msg
({
from
:
sender_jid
,
to
:
this
.
connection
.
jid
,
type
:
'
chat
'
,
to
:
this
.
connection
.
jid
,
type
:
'
chat
'
,
id
:
(
new
Date
()).
getTime
()
}).
c
(
'
body
'
).
t
(
message
).
up
()
.
c
(
'
active
'
,
{
'
xmlns
'
:
'
http://jabber.org/protocol/chatstates
'
}).
tree
();
...
...
@@ -563,8 +563,8 @@
var
sender_jid
=
cur_names
[
0
].
replace
(
'
'
,
'
.
'
).
toLowerCase
()
+
'
@localhost
'
;
msg
=
$msg
({
from
:
sender_jid
,
to
:
this
.
connection
.
jid
,
type
:
'
chat
'
,
to
:
this
.
connection
.
jid
,
type
:
'
chat
'
,
id
:
(
new
Date
()).
getTime
()
}).
c
(
'
body
'
).
t
(
message
).
up
()
.
c
(
'
active
'
,
{
'
xmlns
'
:
'
http://jabber.org/protocol/chatstates
'
}).
tree
();
...
...
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