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
f431bce2
Commit
f431bce2
authored
Jan 09, 2018
by
Weblate
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
fc2dfa8f
d7a113e0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
24 deletions
+29
-24
converse-logs/converse-logs.js
converse-logs/converse-logs.js
+1
-1
spec/transcripts.js
spec/transcripts.js
+27
-22
tests/runner.js
tests/runner.js
+1
-1
No files found.
converse-logs/converse-logs.js
View file @
f431bce2
define
(
"
transcripts
"
,
[
"
tpl!
converse-logs/double_login
s
"
,
"
tpl!
../../converse-logs/missing_message
s
"
,
],
function
()
{
return
arguments
;
});
spec/transcripts.js
View file @
f431bce2
(
function
(
root
,
factory
)
{
define
([
"
jquery
"
,
"
jasmine
"
,
"
converse-core
"
,
"
mock
"
,
"
test
_
utils
"
,
"
test
-
utils
"
,
"
utils
"
,
"
transcripts
"
],
factory
);
}
(
this
,
function
(
$
,
converse
,
mock
,
test_utils
,
utils
,
transcripts
)
{
}
(
this
,
function
(
$
,
jasmine
,
converse
,
mock
,
test_utils
,
utils
,
transcripts
)
{
var
Strophe
=
converse
.
env
.
Strophe
;
var
_
=
converse
.
env
.
_
;
var
IGNORED_TAGS
=
[
...
...
@@ -48,28 +49,32 @@
return
describe
(
"
Transcripts of chat logs
"
,
function
()
{
it
(
"
can be used to replay conversations
"
,
mock
.
initConverse
(
function
(
_converse
)
{
/*
test_utils.openAndEnterChatRoom(_converse, "dummy", 'rooms.localhost', 'jc');
test_utils.openAndEnterChatRoom(_converse, "prosody", 'conference.prosody.im', 'jc');
*/
test_utils
.
openAndEnterChatRoom
(
_converse
,
"
discuss
"
,
'
conference.conversejs.org
'
,
'
jc
'
);
spyOn
(
_converse
,
'
areDesktopNotificationsEnabled
'
).
andReturn
(
true
);
_
.
each
(
transcripts
,
function
(
transcript
)
{
var
text
=
transcript
();
var
xml
=
Strophe
.
xmlHtmlNode
(
text
);
$
(
xml
).
children
(
'
log
'
).
children
(
'
body
'
).
each
(
function
(
i
,
el
)
{
$
(
el
).
children
().
each
(
function
(
i
,
el
)
{
if
(
el
.
nodeType
===
3
)
{
return
;
// Ignore text
}
if
(
_
.
includes
(
IGNORED_TAGS
,
el
.
nodeName
.
toLowerCase
()))
{
return
;
}
var
_stanza
=
traverseElement
(
el
);
_converse
.
connection
.
_dataRecv
(
test_utils
.
createRequest
(
_stanza
));
it
(
"
can be used to replay conversations
"
,
mock
.
initConverseWithPromises
(
null
,
[
'
rosterGroupsFetched
'
],
{},
function
(
done
,
_converse
)
{
_converse
.
allow_non_roster_messaging
=
true
;
test_utils
.
openAndEnterChatRoom
(
_converse
,
'
discuss
'
,
'
conference.conversejs.org
'
,
'
dummy
'
).
then
(
function
()
{
spyOn
(
_converse
,
'
areDesktopNotificationsEnabled
'
).
and
.
returnValue
(
true
);
_
.
each
(
transcripts
,
function
(
transcript
)
{
var
text
=
transcript
();
var
xml
=
Strophe
.
xmlHtmlNode
(
text
);
_
.
each
(
xml
.
firstElementChild
.
children
,
function
(
el
)
{
_
.
each
(
el
.
children
,
function
(
el
)
{
if
(
el
.
nodeType
===
3
)
{
return
;
// Ignore text
}
if
(
_
.
includes
(
IGNORED_TAGS
,
el
.
nodeName
.
toLowerCase
()))
{
return
;
}
var
_stanza
=
traverseElement
(
el
);
_converse
.
connection
.
_dataRecv
(
test_utils
.
createRequest
(
_stanza
));
});
});
});
done
();
});
}));
});
...
...
tests/runner.js
View file @
f431bce2
...
...
@@ -30,8 +30,8 @@ config.shim.jasmine = {
require
.
config
(
config
);
var
specs
=
[
//"spec/transcripts",
"
jasmine
"
,
//"spec/transcripts",
"
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