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
8a862e27
Commit
8a862e27
authored
Apr 24, 2018
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Catch and log errors inside promises
parent
9a410c6a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
16 deletions
+16
-16
spec/chatroom.js
spec/chatroom.js
+16
-16
No files found.
spec/chatroom.js
View file @
8a862e27
...
@@ -2095,7 +2095,7 @@
...
@@ -2095,7 +2095,7 @@
'
<subject xmlns="jabber:client">This is yet another subject</subject>
'
+
'
<subject xmlns="jabber:client">This is yet another subject</subject>
'
+
'
</message>
'
);
'
</message>
'
);
done
();
done
();
});
})
.
catch
(
_
.
partial
(
console
.
error
,
_
))
;
}));
}));
it
(
"
/clear to clear messages
"
,
it
(
"
/clear to clear messages
"
,
...
@@ -2118,7 +2118,7 @@
...
@@ -2118,7 +2118,7 @@
expect
(
view
.
onMessageSubmitted
).
toHaveBeenCalled
();
expect
(
view
.
onMessageSubmitted
).
toHaveBeenCalled
();
expect
(
view
.
clearChatRoomMessages
).
toHaveBeenCalled
();
expect
(
view
.
clearChatRoomMessages
).
toHaveBeenCalled
();
done
();
done
();
});
})
.
catch
(
_
.
partial
(
console
.
error
,
_
))
;
}));
}));
it
(
"
/owner to make a user an owner
"
,
it
(
"
/owner to make a user an owner
"
,
...
@@ -2171,7 +2171,7 @@
...
@@ -2171,7 +2171,7 @@
"
</query>
"
+
"
</query>
"
+
"
</iq>
"
);
"
</iq>
"
);
done
();
done
();
});
})
.
catch
(
_
.
partial
(
console
.
error
,
_
))
;
}));
}));
it
(
"
/ban to ban a user
"
,
it
(
"
/ban to ban a user
"
,
...
@@ -2223,7 +2223,7 @@
...
@@ -2223,7 +2223,7 @@
"
</query>
"
+
"
</query>
"
+
"
</iq>
"
);
"
</iq>
"
);
done
();
done
();
});
})
.
catch
(
_
.
partial
(
console
.
error
,
_
))
;
}));
}));
it
(
"
/kick to kick a user
"
,
it
(
"
/kick to kick a user
"
,
...
@@ -2301,7 +2301,7 @@
...
@@ -2301,7 +2301,7 @@
view
.
el
.
querySelectorAll
(
'
.chat-info
'
)[
3
].
textContent
).
toBe
(
view
.
el
.
querySelectorAll
(
'
.chat-info
'
)[
3
].
textContent
).
toBe
(
"
annoyingGuy has been kicked out
"
);
"
annoyingGuy has been kicked out
"
);
done
();
done
();
});
})
.
catch
(
_
.
partial
(
console
.
error
,
_
))
;
}));
}));
...
@@ -2442,7 +2442,7 @@
...
@@ -2442,7 +2442,7 @@
info_msgs
=
Array
.
prototype
.
slice
.
call
(
view
.
el
.
querySelectorAll
(
'
.chat-info
'
),
0
);
info_msgs
=
Array
.
prototype
.
slice
.
call
(
view
.
el
.
querySelectorAll
(
'
.chat-info
'
),
0
);
expect
(
info_msgs
.
pop
().
textContent
).
toBe
(
"
trustworthyguy is no longer a moderator
"
);
expect
(
info_msgs
.
pop
().
textContent
).
toBe
(
"
trustworthyguy is no longer a moderator
"
);
done
();
done
();
});
})
.
catch
(
_
.
partial
(
console
.
error
,
_
))
;
}));
}));
it
(
"
/mute and /voice to mute and unmute a user
"
,
it
(
"
/mute and /voice to mute and unmute a user
"
,
...
@@ -2582,7 +2582,7 @@
...
@@ -2582,7 +2582,7 @@
info_msgs
=
Array
.
prototype
.
slice
.
call
(
view
.
el
.
querySelectorAll
(
'
.chat-info
'
),
0
);
info_msgs
=
Array
.
prototype
.
slice
.
call
(
view
.
el
.
querySelectorAll
(
'
.chat-info
'
),
0
);
expect
(
info_msgs
.
pop
().
textContent
).
toBe
(
"
annoyingGuy has been given a voice again
"
);
expect
(
info_msgs
.
pop
().
textContent
).
toBe
(
"
annoyingGuy has been given a voice again
"
);
done
();
done
();
});
})
.
catch
(
_
.
partial
(
console
.
error
,
_
))
;
}));
}));
});
});
...
@@ -2621,7 +2621,7 @@
...
@@ -2621,7 +2621,7 @@
view
.
el
.
querySelector
(
'
input[type=submit]
'
).
click
();
view
.
el
.
querySelector
(
'
input[type=submit]
'
).
click
();
expect
(
view
.
join
).
toHaveBeenCalledWith
(
'
dummy
'
,
'
secret
'
);
expect
(
view
.
join
).
toHaveBeenCalledWith
(
'
dummy
'
,
'
secret
'
);
done
();
done
();
});
})
.
catch
(
_
.
partial
(
console
.
error
,
_
))
;
}));
}));
it
(
"
will show an error message if the room is members-only and the user not included
"
,
it
(
"
will show an error message if the room is members-only and the user not included
"
,
...
@@ -2644,7 +2644,7 @@
...
@@ -2644,7 +2644,7 @@
_converse
.
connection
.
_dataRecv
(
test_utils
.
createRequest
(
presence
));
_converse
.
connection
.
_dataRecv
(
test_utils
.
createRequest
(
presence
));
expect
(
$
(
view
.
el
).
find
(
'
.chatroom-body p:last
'
).
text
()).
toBe
(
'
You are not on the member list of this room.
'
);
expect
(
$
(
view
.
el
).
find
(
'
.chatroom-body p:last
'
).
text
()).
toBe
(
'
You are not on the member list of this room.
'
);
done
();
done
();
});
})
.
catch
(
_
.
partial
(
console
.
error
,
_
))
;
}));
}));
it
(
"
will show an error message if the user has been banned
"
,
it
(
"
will show an error message if the user has been banned
"
,
...
@@ -2667,7 +2667,7 @@
...
@@ -2667,7 +2667,7 @@
_converse
.
connection
.
_dataRecv
(
test_utils
.
createRequest
(
presence
));
_converse
.
connection
.
_dataRecv
(
test_utils
.
createRequest
(
presence
));
expect
(
$
(
view
.
el
).
find
(
'
.chatroom-body p:last
'
).
text
()).
toBe
(
'
You have been banned from this room.
'
);
expect
(
$
(
view
.
el
).
find
(
'
.chatroom-body p:last
'
).
text
()).
toBe
(
'
You have been banned from this room.
'
);
done
();
done
();
});
})
.
catch
(
_
.
partial
(
console
.
error
,
_
))
;
}));
}));
it
(
"
will render a nickname form if a nickname conflict happens and muc_nickname_from_jid=false
"
,
it
(
"
will render a nickname form if a nickname conflict happens and muc_nickname_from_jid=false
"
,
...
@@ -2694,7 +2694,7 @@
...
@@ -2694,7 +2694,7 @@
$input
.
val
(
'
nicky
'
);
$input
.
val
(
'
nicky
'
);
view
.
el
.
querySelector
(
'
input[type=submit]
'
).
click
();
view
.
el
.
querySelector
(
'
input[type=submit]
'
).
click
();
done
();
done
();
});
})
.
catch
(
_
.
partial
(
console
.
error
,
_
))
;
}));
}));
it
(
"
will automatically choose a new nickname if a nickname conflict happens and muc_nickname_from_jid=true
"
,
it
(
"
will automatically choose a new nickname if a nickname conflict happens and muc_nickname_from_jid=true
"
,
...
@@ -2756,7 +2756,7 @@
...
@@ -2756,7 +2756,7 @@
_converse
.
connection
.
_dataRecv
(
test_utils
.
createRequest
(
presence
));
_converse
.
connection
.
_dataRecv
(
test_utils
.
createRequest
(
presence
));
expect
(
view
.
join
).
toHaveBeenCalledWith
(
'
dummy-4
'
);
expect
(
view
.
join
).
toHaveBeenCalledWith
(
'
dummy-4
'
);
done
();
done
();
});
})
.
catch
(
_
.
partial
(
console
.
error
,
_
))
;
}));
}));
it
(
"
will show an error message if the user is not allowed to have created the room
"
,
it
(
"
will show an error message if the user is not allowed to have created the room
"
,
...
@@ -2779,7 +2779,7 @@
...
@@ -2779,7 +2779,7 @@
_converse
.
connection
.
_dataRecv
(
test_utils
.
createRequest
(
presence
));
_converse
.
connection
.
_dataRecv
(
test_utils
.
createRequest
(
presence
));
expect
(
$
(
view
.
el
).
find
(
'
.chatroom-body p:last
'
).
text
()).
toBe
(
'
You are not allowed to create new rooms.
'
);
expect
(
$
(
view
.
el
).
find
(
'
.chatroom-body p:last
'
).
text
()).
toBe
(
'
You are not allowed to create new rooms.
'
);
done
();
done
();
});
})
.
catch
(
_
.
partial
(
console
.
error
,
_
))
;
}));
}));
it
(
"
will show an error message if the user's nickname doesn't conform to room policy
"
,
it
(
"
will show an error message if the user's nickname doesn't conform to room policy
"
,
...
@@ -2802,7 +2802,7 @@
...
@@ -2802,7 +2802,7 @@
_converse
.
connection
.
_dataRecv
(
test_utils
.
createRequest
(
presence
));
_converse
.
connection
.
_dataRecv
(
test_utils
.
createRequest
(
presence
));
expect
(
$
(
view
.
el
).
find
(
'
.chatroom-body p:last
'
).
text
()).
toBe
(
"
Your nickname doesn't conform to this room's policies.
"
);
expect
(
$
(
view
.
el
).
find
(
'
.chatroom-body p:last
'
).
text
()).
toBe
(
"
Your nickname doesn't conform to this room's policies.
"
);
done
();
done
();
});
})
.
catch
(
_
.
partial
(
console
.
error
,
_
))
;
}));
}));
it
(
"
will show an error message if the room doesn't yet exist
"
,
it
(
"
will show an error message if the room doesn't yet exist
"
,
...
@@ -2825,7 +2825,7 @@
...
@@ -2825,7 +2825,7 @@
_converse
.
connection
.
_dataRecv
(
test_utils
.
createRequest
(
presence
));
_converse
.
connection
.
_dataRecv
(
test_utils
.
createRequest
(
presence
));
expect
(
$
(
view
.
el
).
find
(
'
.chatroom-body p:last
'
).
text
()).
toBe
(
"
This room does not (yet) exist.
"
);
expect
(
$
(
view
.
el
).
find
(
'
.chatroom-body p:last
'
).
text
()).
toBe
(
"
This room does not (yet) exist.
"
);
done
();
done
();
});
})
.
catch
(
_
.
partial
(
console
.
error
,
_
))
;
}));
}));
it
(
"
will show an error message if the room has reached its maximum number of occupants
"
,
it
(
"
will show an error message if the room has reached its maximum number of occupants
"
,
...
@@ -2848,7 +2848,7 @@
...
@@ -2848,7 +2848,7 @@
_converse
.
connection
.
_dataRecv
(
test_utils
.
createRequest
(
presence
));
_converse
.
connection
.
_dataRecv
(
test_utils
.
createRequest
(
presence
));
expect
(
$
(
view
.
el
).
find
(
'
.chatroom-body p:last
'
).
text
()).
toBe
(
"
This room has reached its maximum number of occupants.
"
);
expect
(
$
(
view
.
el
).
find
(
'
.chatroom-body p:last
'
).
text
()).
toBe
(
"
This room has reached its maximum number of occupants.
"
);
done
();
done
();
});
})
.
catch
(
_
.
partial
(
console
.
error
,
_
))
;
}));
}));
});
});
...
...
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