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
7319ebf0
Commit
7319ebf0
authored
Sep 23, 2016
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use 'connected' event instead of 'initialized' which has been deprecated
parent
69720660
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
16 deletions
+16
-16
spec/eventemitter.js
spec/eventemitter.js
+16
-16
No files found.
spec/eventemitter.js
View file @
7319ebf0
...
...
@@ -16,24 +16,24 @@
it
(
"
allows you to subscribe to emitted events
"
,
function
()
{
this
.
callback
=
function
()
{};
spyOn
(
this
,
'
callback
'
);
converse
.
on
(
'
initializ
ed
'
,
this
.
callback
);
converse
.
emit
(
'
initializ
ed
'
);
converse
.
on
(
'
connect
ed
'
,
this
.
callback
);
converse
.
emit
(
'
connect
ed
'
);
expect
(
this
.
callback
).
toHaveBeenCalled
();
converse
.
emit
(
'
initializ
ed
'
);
converse
.
emit
(
'
connect
ed
'
);
expect
(
this
.
callback
.
callCount
,
2
);
converse
.
emit
(
'
initializ
ed
'
);
converse
.
emit
(
'
connect
ed
'
);
expect
(
this
.
callback
.
callCount
,
3
);
});
it
(
"
allows you to listen once for an emitted event
"
,
function
()
{
this
.
callback
=
function
()
{};
spyOn
(
this
,
'
callback
'
);
converse
.
once
(
'
initializ
ed
'
,
this
.
callback
);
converse
.
emit
(
'
initializ
ed
'
);
converse
.
once
(
'
connect
ed
'
,
this
.
callback
);
converse
.
emit
(
'
connect
ed
'
);
expect
(
this
.
callback
).
toHaveBeenCalled
();
converse
.
emit
(
'
initializ
ed
'
);
converse
.
emit
(
'
connect
ed
'
);
expect
(
this
.
callback
.
callCount
,
1
);
converse
.
emit
(
'
initializ
ed
'
);
converse
.
emit
(
'
connect
ed
'
);
expect
(
this
.
callback
.
callCount
,
1
);
});
...
...
@@ -45,23 +45,23 @@
spyOn
(
this
,
'
callback
'
);
spyOn
(
this
,
'
anotherCallback
'
);
spyOn
(
this
,
'
neverCalled
'
);
converse
.
on
(
'
initializ
ed
'
,
this
.
callback
);
converse
.
on
(
'
initializ
ed
'
,
this
.
anotherCallback
);
converse
.
on
(
'
connect
ed
'
,
this
.
callback
);
converse
.
on
(
'
connect
ed
'
,
this
.
anotherCallback
);
converse
.
emit
(
'
initializ
ed
'
);
converse
.
emit
(
'
connect
ed
'
);
expect
(
this
.
callback
).
toHaveBeenCalled
();
expect
(
this
.
anotherCallback
).
toHaveBeenCalled
();
converse
.
off
(
'
initializ
ed
'
,
this
.
callback
);
converse
.
off
(
'
connect
ed
'
,
this
.
callback
);
converse
.
emit
(
'
initializ
ed
'
);
converse
.
emit
(
'
connect
ed
'
);
expect
(
this
.
callback
.
callCount
,
1
);
expect
(
this
.
anotherCallback
.
callCount
,
2
);
converse
.
once
(
'
initializ
ed
'
,
this
.
neverCalled
);
converse
.
off
(
'
initializ
ed
'
,
this
.
neverCalled
);
converse
.
once
(
'
connect
ed
'
,
this
.
neverCalled
);
converse
.
off
(
'
connect
ed
'
,
this
.
neverCalled
);
converse
.
emit
(
'
initializ
ed
'
);
converse
.
emit
(
'
connect
ed
'
);
expect
(
this
.
callback
.
callCount
,
1
);
expect
(
this
.
anotherCallback
.
callCount
,
3
);
expect
(
this
.
neverCalled
).
not
.
toHaveBeenCalled
();
...
...
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