adjust jsunit tests

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
Arthur Schiwon 2017-11-01 11:27:04 +01:00
parent 25aad121e6
commit 2b4b3b1986
No known key found for this signature in database
GPG key ID: 7424F1874854DF23
3 changed files with 10 additions and 7 deletions

Binary file not shown.

View file

@ -157,7 +157,7 @@ describe('OCA.Comments.CommentsTabView tests', function() {
expect($comment.find('.avatar[data-user=macbeth] ~ .contactsmenu-popover').length).toEqual(1);
expect($comment.find('.avatar[data-user=banquo]').length).toEqual(1);
expect($comment.find('.avatar-name-wrapper:last-child strong').text()).toEqual('Lord Banquo');
expect($comment.find('.avatar[data-user=banquo] ~ strong').text()).toEqual('Lord Banquo');
expect($comment.find('.avatar[data-user=banquo] ~ .contactsmenu-popover').length).toEqual(1);
});
@ -239,7 +239,7 @@ describe('OCA.Comments.CommentsTabView tests', function() {
});
it('creates a new comment when clicking post button', function() {
view.$el.find('.message').val('New message');
view.$el.find('.message').text('New message');
view.$el.find('form').submit();
expect(createStub.calledOnce).toEqual(true);
@ -253,7 +253,7 @@ describe('OCA.Comments.CommentsTabView tests', function() {
});
});
it('creates a new comment with mentions when clicking post button', function() {
view.$el.find('.message').val('New message @anotheruser');
view.$el.find('.message').text('New message @anotheruser');
view.$el.find('form').submit();
var createStubExpectedData = {
@ -439,7 +439,7 @@ describe('OCA.Comments.CommentsTabView tests', function() {
var $formRow = view.$el.find('.newCommentRow.comment[data-id=1]');
expect($formRow.length).toEqual(1);
$formRow.find('textarea').val('modified message');
$formRow.find('div.message').text('modified message');
$formRow.find('form').submit();
expect(saveStub.calledOnce).toEqual(true);
@ -451,8 +451,9 @@ describe('OCA.Comments.CommentsTabView tests', function() {
// simulate the fact that save sets the attribute
model.set('message', 'modified\nmessage');
saveStub.yieldTo('success', model);
view.collection.get(model);
expect(fetchStub.calledOnce).toEqual(true);
expect(fetchStub.called).toEqual(true);
fetchStub.yieldTo('success', model);
// original comment element is visible again
@ -472,7 +473,7 @@ describe('OCA.Comments.CommentsTabView tests', function() {
var $formRow = view.$el.find('.newCommentRow.comment[data-id=3]');
expect($formRow.length).toEqual(1);
$formRow.find('textarea').val('modified\nmessage @anotheruser');
$formRow.find('div.message').text('modified\nmessage @anotheruser');
$formRow.find('form').submit();
expect(saveStub.calledOnce).toEqual(true);
@ -485,7 +486,7 @@ describe('OCA.Comments.CommentsTabView tests', function() {
model.set('message', 'modified\nmessage @anotheruser');
saveStub.yieldTo('success', model);
expect(fetchStub.calledOnce).toEqual(true);
expect(fetchStub.called).toEqual(true);
// simulate the fact that fetch sets the attribute
model.set('mentions', {

View file

@ -88,6 +88,8 @@ module.exports = function(config) {
srcFiles: [
// need to enforce loading order...
'apps/comments/js/app.js',
'apps/comments/js/vendor/Caret.js/dist/jquery.caret.min.js',
'apps/comments/js/vendor/At.js/dist/js/jquery.atwho.min.js',
'apps/comments/js/commentmodel.js',
'apps/comments/js/commentcollection.js',
'apps/comments/js/commentsummarymodel.js',