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
624ab458
Commit
624ab458
authored
Dec 09, 2012
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve suite names. Use toMatch matcher
parent
85e419af
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
spec/StorageSpec.js
spec/StorageSpec.js
+6
-8
No files found.
spec/StorageSpec.js
View file @
624ab458
...
...
@@ -10,13 +10,13 @@
return
(
new
Array
(
times
+
1
)).
join
(
this
+
'
'
).
replace
(
/
\s
$/
,
''
);
};
return
describe
(
"
xmppchat.ClientStorage
"
,
function
()
{
return
describe
(
"
Local storage of messages and open chats
"
,
function
()
{
beforeEach
(
function
()
{
this
.
storage
=
new
xmppchat
.
ClientStorage
(
'
dummy@localhost
'
);
});
describe
(
"
storing open chats
"
,
function
()
{
describe
(
"
open chat storage
"
,
function
()
{
beforeEach
(
function
()
{
// Removes all stored items
...
...
@@ -66,7 +66,7 @@
});
});
describe
(
"
storing messages
"
,
function
()
{
describe
(
"
message storage
"
,
function
()
{
var
iso_regex
=
/
\d{4}
-
[
01
]\d
-
[
0-3
]\d
T
[
0-2
]\d
:
[
0-5
]\d
:
[
0-5
]\d\.\d
+
([
+-
][
0-2
]\d
:
[
0-5
]\d
|Z
)
/
;
...
...
@@ -87,8 +87,7 @@
// First two space separated strings are ISO date and direction
var
msg_arr
=
msgs
[
i
].
split
(
'
'
,
2
);
// Check that first string is ISO format
var
match
=
msg_arr
[
0
].
match
(
iso_regex
);
expect
(
match
).
toBeTruthy
();
expect
(
msg_arr
[
0
]).
toMatch
(
iso_regex
);
expect
(
msg_arr
[
0
]).
toEqual
(
jasmine
.
any
(
String
));
expect
(
msg_arr
[
1
]).
toEqual
(
'
to
'
);
expect
(
msgs
[
i
].
replace
(
/
(
.*
?\s
.*
?\s)
/
,
''
)).
toEqual
(
msg
);
...
...
@@ -97,10 +96,9 @@
it
(
"
should be able to get last message
"
,
function
()
{
var
msg
=
this
.
storage
.
getLastMessage
(
'
chat@localhost
'
),
msg_arr
=
msg
.
split
(
'
'
,
2
),
match
=
msg_arr
[
0
].
match
(
iso_regex
);
msg_arr
=
msg
.
split
(
'
'
,
2
);
expect
(
m
atch
).
toBeTruthy
(
);
expect
(
m
sg_arr
[
0
]).
toMatch
(
iso_regex
);
expect
(
msg_arr
[
0
]).
toEqual
(
jasmine
.
any
(
String
));
expect
(
msg_arr
[
1
]).
toEqual
(
'
to
'
);
expect
(
msg
.
replace
(
/
(
.*
?\s
.*
?\s)
/
,
''
)).
toEqual
(
'
msg
'
.
repeat
(
10
));
...
...
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