mirror of
https://github.com/wassname/talk.git
synced 2026-07-04 22:30:38 +08:00
Adjusted test to conform to new form
This commit is contained in:
@@ -170,7 +170,10 @@ describe('graph.mutations.createComment', () => {
|
||||
const context = new Context({user: new UserModel({status: 'ACTIVE'})});
|
||||
|
||||
return graphql(schema, query, {}, context, {
|
||||
body
|
||||
comment: {
|
||||
asset_id: '123',
|
||||
body
|
||||
}
|
||||
})
|
||||
.then(({data, errors}) => {
|
||||
expect(errors).to.be.undefined;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
const expect = require('chai').expect;
|
||||
const {graphql} = require('graphql');
|
||||
|
||||
const schema = require('../../../graph/schema');
|
||||
const Context = require('../../../graph/context');
|
||||
const UsersService = require('../../../services/users');
|
||||
const SettingsService = require('../../../services/settings');
|
||||
const schema = require('../../../../graph/schema');
|
||||
const Context = require('../../../../graph/context');
|
||||
const UsersService = require('../../../../services/users');
|
||||
const SettingsService = require('../../../../services/settings');
|
||||
|
||||
const ignoreUserMutation = `
|
||||
mutation ignoreUser ($id: ID!) {
|
||||
@@ -94,7 +94,7 @@ describe('graph.mutations.stopIgnoringUser', () => {
|
||||
if (response.errors && response.errors.length) {
|
||||
console.error(response.errors);
|
||||
}
|
||||
expect(response.errors).to.be.empty;
|
||||
expect(response.errors).to.be.empty;
|
||||
});
|
||||
|
||||
const stopIgnoringUserMutation = `
|
||||
@@ -112,7 +112,7 @@ describe('graph.mutations.stopIgnoringUser', () => {
|
||||
if (stopIgnoringUserResponse.errors && stopIgnoringUserResponse.errors.length) {
|
||||
console.error(stopIgnoringUserResponse.errors);
|
||||
}
|
||||
expect(stopIgnoringUserResponse.errors).to.be.empty;
|
||||
expect(stopIgnoringUserResponse.errors).to.be.empty;
|
||||
|
||||
// now check my ignored users
|
||||
const myIgnoredUsersResponse = await graphql(schema, getMyIgnoredUsersQuery, {}, context, {});
|
||||
@@ -1,12 +1,12 @@
|
||||
const expect = require('chai').expect;
|
||||
const {graphql} = require('graphql');
|
||||
|
||||
const schema = require('../../../graph/schema');
|
||||
const Context = require('../../../graph/context');
|
||||
const UsersService = require('../../../services/users');
|
||||
const SettingsService = require('../../../services/settings');
|
||||
const Asset = require('../../../models/asset');
|
||||
const CommentsService = require('../../../services/comments');
|
||||
const schema = require('../../../../graph/schema');
|
||||
const Context = require('../../../../graph/context');
|
||||
const UsersService = require('../../../../services/users');
|
||||
const SettingsService = require('../../../../services/settings');
|
||||
const Asset = require('../../../../models/asset');
|
||||
const CommentsService = require('../../../../services/comments');
|
||||
|
||||
describe('graph.queries.asset', () => {
|
||||
beforeEach(async () => {
|
||||
@@ -87,7 +87,7 @@ describe('graph.queries.asset', () => {
|
||||
`;
|
||||
const assetCommentsResponse = await graphql(schema, assetCommentsWithoutIgnoredQuery, {}, context, {assetId, assetUrl, excludeIgnored: true});
|
||||
const comments = assetCommentsResponse.data.asset.comments;
|
||||
expect(comments.length).to.equal(2);
|
||||
expect(comments.length).to.equal(2);
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user