Error on duplicate.

This commit is contained in:
gaba
2017-05-08 13:11:48 -07:00
parent 28920eb357
commit cb09c50820
19 changed files with 173 additions and 266 deletions
+3 -3
View File
@@ -9,7 +9,7 @@ const AssetModel = require('../../../../models/asset');
const ActionModel = require('../../../../models/action');
const SettingsService = require('../../../../services/settings');
const TagService = require('../../../../services/tags');
const CommentsService = require('../../../../services/comments');
describe('graph.mutations.createComment', () => {
beforeEach(() => SettingsService.init());
@@ -223,9 +223,9 @@ describe('graph.mutations.createComment', () => {
expect(data.createComment).to.have.property('comment').not.null;
expect(data.createComment).to.have.property('errors').null;
return TagService.findByItemIdAndName(data.createComment.comment.id, tag, 'COMMENTS');
return CommentsService.findById(data.createComment.comment.id);
})
.then((tags) => {
.then(({tags}) => {
if (tag) {
expect(tags).to.have.length(1);
expect(tags[0]).to.have.property('name', tag);