simplified test layout

This commit is contained in:
Wyatt Johnson
2017-08-19 10:22:26 -06:00
parent a7a80a452b
commit d38dbc87b6
27 changed files with 64 additions and 161 deletions
+5 -4
View File
@@ -1,4 +1,3 @@
const expect = require('chai').expect;
const {graphql} = require('graphql');
const timekeeper = require('timekeeper');
@@ -9,6 +8,8 @@ const AssetModel = require('../../../../models/asset');
const SettingsService = require('../../../../services/settings');
const CommentsService = require('../../../../services/comments');
const {expect} = require('chai');
describe('graph.mutations.editComment', () => {
let asset;
let user;
@@ -133,7 +134,7 @@ describe('graph.mutations.editComment', () => {
expect(response.errors).to.be.empty;
expect(response.data.editComment.errors).to.not.be.empty;
expect(response.data.editComment.errors[0].translation_key).to.equal('NOT_AUTHORIZED');
const commentAfterEdit = await CommentsService.findById(comment.id);
const commentAfterEdit = await CommentsService.findById(comment.id);
// it *hasn't* changed from the original
expect(commentAfterEdit.body).to.equal(comment.body);
@@ -256,7 +257,7 @@ describe('graph.mutations.editComment', () => {
expect(response.errors).to.be.empty;
const commentAfterEdit = await CommentsService.findById(comment.id);
expect(commentAfterEdit.body).to.equal(newBody);
expect(commentAfterEdit.status).to.equal(afterEdit.status);
expect(commentAfterEdit.status).to.equal(afterEdit.status);
});
});
});
});