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
eec2a4f5
Commit
eec2a4f5
authored
Mar 23, 2016
by
Viktor Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tests for #609
parent
ad036ea7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
spec/chatbox.js
spec/chatbox.js
+8
-10
No files found.
spec/chatbox.js
View file @
eec2a4f5
...
...
@@ -446,9 +446,7 @@
expect
(
chatbox
.
messages
.
length
).
toEqual
(
1
);
var
msg_obj
=
chatbox
.
messages
.
models
[
0
];
expect
(
msg_obj
.
get
(
'
message
'
)).
toEqual
(
message
);
// XXX: This is stupid, fullname is actually only the
// users first name
expect
(
msg_obj
.
get
(
'
fullname
'
)).
toEqual
(
mock
.
cur_names
[
0
].
split
(
'
'
)[
0
]);
expect
(
msg_obj
.
get
(
'
fullname
'
)).
toEqual
(
mock
.
cur_names
[
0
]);
expect
(
msg_obj
.
get
(
'
sender
'
)).
toEqual
(
'
them
'
);
expect
(
msg_obj
.
get
(
'
delayed
'
)).
toEqual
(
false
);
// Now check that the message appears inside the chatbox in the DOM
...
...
@@ -506,7 +504,7 @@
expect
(
chatbox
.
messages
.
length
).
toEqual
(
1
);
var
msg_obj
=
chatbox
.
messages
.
models
[
0
];
expect
(
msg_obj
.
get
(
'
message
'
)).
toEqual
(
msgtext
);
expect
(
msg_obj
.
get
(
'
fullname
'
)).
toEqual
(
mock
.
cur_names
[
1
]
.
split
(
'
'
)[
0
]
);
expect
(
msg_obj
.
get
(
'
fullname
'
)).
toEqual
(
mock
.
cur_names
[
1
]);
expect
(
msg_obj
.
get
(
'
sender
'
)).
toEqual
(
'
them
'
);
expect
(
msg_obj
.
get
(
'
delayed
'
)).
toEqual
(
false
);
// Now check that the message appears inside the chatbox in the DOM
...
...
@@ -547,7 +545,7 @@
expect
(
chatbox
.
messages
.
length
).
toEqual
(
1
);
var
msg_obj
=
chatbox
.
messages
.
models
[
0
];
expect
(
msg_obj
.
get
(
'
message
'
)).
toEqual
(
msgtext
);
expect
(
msg_obj
.
get
(
'
fullname
'
)).
toEqual
(
mock
.
cur_names
[
5
]
.
split
(
'
'
)[
0
]
);
expect
(
msg_obj
.
get
(
'
fullname
'
)).
toEqual
(
mock
.
cur_names
[
5
]);
expect
(
msg_obj
.
get
(
'
sender
'
)).
toEqual
(
'
me
'
);
expect
(
msg_obj
.
get
(
'
delayed
'
)).
toEqual
(
false
);
// Now check that the message appears inside the chatbox in the DOM
...
...
@@ -631,7 +629,7 @@
expect
(
chatbox
.
messages
.
length
).
toEqual
(
1
);
msg_obj
=
chatbox
.
messages
.
models
[
0
];
expect
(
msg_obj
.
get
(
'
message
'
)).
toEqual
(
message
);
expect
(
msg_obj
.
get
(
'
fullname
'
)).
toEqual
(
contact_name
.
split
(
'
'
)[
0
]
);
expect
(
msg_obj
.
get
(
'
fullname
'
)).
toEqual
(
contact_name
);
expect
(
msg_obj
.
get
(
'
sender
'
)).
toEqual
(
'
them
'
);
expect
(
msg_obj
.
get
(
'
delayed
'
)).
toEqual
(
true
);
msg_txt
=
$chat_content
.
find
(
'
.chat-message
'
).
find
(
'
.chat-msg-content
'
).
text
();
...
...
@@ -662,7 +660,7 @@
expect
(
chatbox
.
messages
.
length
).
toEqual
(
2
);
msg_obj
=
chatbox
.
messages
.
models
[
1
];
expect
(
msg_obj
.
get
(
'
message
'
)).
toEqual
(
message
);
expect
(
msg_obj
.
get
(
'
fullname
'
)).
toEqual
(
contact_name
.
split
(
'
'
)[
0
]
);
expect
(
msg_obj
.
get
(
'
fullname
'
)).
toEqual
(
contact_name
);
expect
(
msg_obj
.
get
(
'
sender
'
)).
toEqual
(
'
them
'
);
expect
(
msg_obj
.
get
(
'
delayed
'
)).
toEqual
(
false
);
msg_txt
=
$chat_content
.
find
(
'
.chat-message
'
).
last
().
find
(
'
.chat-msg-content
'
).
text
();
...
...
@@ -893,7 +891,7 @@
// Check that the notification appears inside the chatbox in the DOM
var
$events
=
chatboxview
.
$el
.
find
(
'
.chat-event
'
);
expect
(
$events
.
length
).
toBe
(
1
);
expect
(
$events
.
text
()).
toEqual
(
mock
.
cur_names
[
1
]
.
split
(
'
'
)[
0
]
+
'
is typing
'
);
expect
(
$events
.
text
()).
toEqual
(
mock
.
cur_names
[
1
]
+
'
is typing
'
);
}.
bind
(
converse
));
}.
bind
(
converse
));
...
...
@@ -967,7 +965,7 @@
var
chatboxview
=
this
.
chatboxviews
.
get
(
sender_jid
);
var
$events
=
chatboxview
.
$el
.
find
(
'
.chat-event
'
);
expect
(
$events
.
length
).
toBe
(
1
);
expect
(
$events
.
text
()).
toEqual
(
mock
.
cur_names
[
1
]
.
split
(
'
'
)[
0
]
+
'
has stopped typing
'
);
expect
(
$events
.
text
()).
toEqual
(
mock
.
cur_names
[
1
]
+
'
has stopped typing
'
);
}.
bind
(
converse
));
}.
bind
(
converse
));
...
...
@@ -1073,7 +1071,7 @@
var
chatboxview
=
this
.
chatboxviews
.
get
(
sender_jid
);
var
$events
=
chatboxview
.
$el
.
find
(
'
.chat-event
'
);
expect
(
$events
.
length
).
toBe
(
1
);
expect
(
$events
.
text
()).
toEqual
(
mock
.
cur_names
[
1
]
.
split
(
'
'
)[
0
]
+
'
has gone away
'
);
expect
(
$events
.
text
()).
toEqual
(
mock
.
cur_names
[
1
]
+
'
has gone away
'
);
}.
bind
(
converse
));
}.
bind
(
converse
));
}.
bind
(
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