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
c0095d4d
Commit
c0095d4d
authored
Apr 14, 2013
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New test
Test that chatboxes are removed from localStorage when closed
parent
66dde5e9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
spec/MainSpec.js
spec/MainSpec.js
+11
-4
No files found.
spec/MainSpec.js
View file @
c0095d4d
...
@@ -305,16 +305,23 @@
...
@@ -305,16 +305,23 @@
var
chatbox
,
view
,
$el
;
var
chatbox
,
view
,
$el
;
for
(
i
=
0
;
i
<
this
.
chatboxes
.
length
;
i
++
)
{
for
(
i
=
0
;
i
<
this
.
chatboxes
.
length
;
i
++
)
{
chatbox
=
this
.
chatboxes
.
models
[
i
];
chatbox
=
this
.
chatboxes
.
models
[
i
];
if
(
chatbox
.
get
(
'
id
'
)
==
'
controlbox
'
)
{
view
=
this
.
chatboxesview
.
views
[
chatbox
.
get
(
'
id
'
)];
continue
;
}
view
=
this
.
chatboxesview
.
views
[
chatbox
.
get
(
'
jid
'
)];
spyOn
(
view
,
'
closeChat
'
).
andCallThrough
();
spyOn
(
view
,
'
closeChat
'
).
andCallThrough
();
view
.
delegateEvents
();
// We need to rebind all events otherwise our spy won't be called
view
.
delegateEvents
();
// We need to rebind all events otherwise our spy won't be called
view
.
$el
.
find
(
'
.close-chatbox-button
'
).
click
();
view
.
$el
.
find
(
'
.close-chatbox-button
'
).
click
();
expect
(
view
.
closeChat
).
toHaveBeenCalled
();
expect
(
view
.
closeChat
).
toHaveBeenCalled
();
}
}
},
xmppchat
));
},
xmppchat
));
it
(
"
will be removed from localStorage when closed
"
,
$
.
proxy
(
function
()
{
var
old_chatboxes
=
this
.
chatboxes
;
expect
(
this
.
chatboxes
.
length
).
toEqual
(
6
);
this
.
chatboxes
=
new
this
.
ChatBoxes
();
expect
(
this
.
chatboxes
.
length
).
toEqual
(
0
);
this
.
chatboxes
.
onConnected
();
expect
(
this
.
chatboxes
.
length
).
toEqual
(
0
);
},
xmppchat
));
},
xmppchat
));
},
xmppchat
));
},
xmppchat
));
},
xmppchat
));
...
...
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