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
ed33d4e5
Commit
ed33d4e5
authored
Feb 02, 2018
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add spec for spoilers, clean up linting errors
parent
be8b9edf
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
202 additions
and
187 deletions
+202
-187
spec/chatbox.js
spec/chatbox.js
+1
-1
spec/spoilers.js
spec/spoilers.js
+66
-0
src/converse-spoilers.js
src/converse-spoilers.js
+134
-186
tests/runner.js
tests/runner.js
+1
-0
No files found.
spec/chatbox.js
View file @
ed33d4e5
...
...
@@ -17,7 +17,7 @@
var
moment
=
converse
.
env
.
moment
;
var
u
=
converse
.
env
.
utils
;
return
describe
(
"
Chatboxes
"
,
function
()
{
return
describe
(
"
Chatboxes
"
,
function
()
{
describe
(
"
A Chatbox
"
,
function
()
{
it
(
"
has a /help command to show the available commands
"
,
...
...
spec/spoilers.js
0 → 100644
View file @
ed33d4e5
(
function
(
root
,
factory
)
{
define
([
"
jasmine
"
,
"
utils
"
,
"
mock
"
,
"
converse-core
"
,
"
test-utils
"
],
factory
);
}
(
this
,
function
(
jasmine
,
utils
,
mock
,
converse
,
test_utils
)
{
var
_
=
converse
.
env
.
_
;
return
describe
(
"
A spoiler message
"
,
function
()
{
it
(
"
can be sent without a hint
"
,
mock
.
initConverseWithPromises
(
null
,
[
'
rosterGroupsFetched
'
],
{},
function
(
done
,
_converse
)
{
test_utils
.
createContacts
(
_converse
,
'
current
'
);
test_utils
.
openControlBox
();
test_utils
.
openContactsPanel
(
_converse
);
var
contact_jid
=
mock
.
cur_names
[
0
].
replace
(
/ /g
,
'
.
'
).
toLowerCase
()
+
'
@localhost
'
;
test_utils
.
openChatBoxFor
(
_converse
,
contact_jid
);
var
view
=
_converse
.
chatboxviews
.
get
(
contact_jid
);
spyOn
(
view
,
'
onMessageSubmitted
'
).
and
.
callThrough
();
var
spoiler_toggle
=
view
.
el
.
querySelector
(
'
.toggle-spoiler-edit
'
);
spoiler_toggle
.
click
();
var
textarea
=
view
.
el
.
querySelector
(
'
.chat-textarea
'
);
textarea
.
value
=
'
This is the spoiler
'
;
view
.
keyPressed
({
target
:
textarea
,
preventDefault
:
_
.
noop
,
keyCode
:
13
});
expect
(
view
.
onMessageSubmitted
).
toHaveBeenCalled
();
done
();
}));
it
(
"
can be sent with a hint
"
,
mock
.
initConverseWithPromises
(
null
,
[
'
rosterGroupsFetched
'
],
{},
function
(
done
,
_converse
)
{
test_utils
.
createContacts
(
_converse
,
'
current
'
);
test_utils
.
openControlBox
();
test_utils
.
openContactsPanel
(
_converse
);
var
contact_jid
=
mock
.
cur_names
[
0
].
replace
(
/ /g
,
'
.
'
).
toLowerCase
()
+
'
@localhost
'
;
test_utils
.
openChatBoxFor
(
_converse
,
contact_jid
);
var
view
=
_converse
.
chatboxviews
.
get
(
contact_jid
);
var
spoiler_toggle
=
view
.
el
.
querySelector
(
'
.toggle-spoiler-edit
'
);
spoiler_toggle
.
click
();
var
hint_input
=
view
.
el
.
querySelector
(
'
.chat-textarea-hint
'
);
// TODO
done
();
}));
});
}));
src/converse-spoilers.js
View file @
ed33d4e5
This diff is collapsed.
Click to expand it.
tests/runner.js
View file @
ed33d4e5
...
...
@@ -32,6 +32,7 @@ require.config(config);
var
specs
=
[
"
jasmine
"
,
//"spec/transcripts",
"
spec/spoilers
"
,
"
spec/profiling
"
,
"
spec/utils
"
,
"
spec/converse
"
,
...
...
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