diff --git a/.gitignore b/.gitignore index f4014b561..e8dfd14e7 100644 --- a/.gitignore +++ b/.gitignore @@ -18,4 +18,6 @@ plugins.json plugins/* !plugins/coral-plugin-facebook-auth !plugins/coral-plugin-respect +!plugins/coral-plugin-offtopic + **/node_modules/* diff --git a/client/coral-embed-stream/src/Comment.js b/client/coral-embed-stream/src/Comment.js index 4b01e19a7..4a75a19cb 100644 --- a/client/coral-embed-stream/src/Comment.js +++ b/client/coral-embed-stream/src/Comment.js @@ -168,7 +168,7 @@ class Comment extends React.Component { ? : null } - + { (currentUser && (comment.user.id !== currentUser.id)) ? @@ -209,7 +209,7 @@ class Comment extends React.Component { removeBest={removeBestTag} /> - +
diff --git a/client/coral-framework/components/Slot.css b/client/coral-framework/components/Slot.css new file mode 100644 index 000000000..6048da181 --- /dev/null +++ b/client/coral-framework/components/Slot.css @@ -0,0 +1,3 @@ +.inline { + display: inline-block; +} diff --git a/client/coral-framework/components/Slot.js b/client/coral-framework/components/Slot.js index 0e5cf86c2..c1e5dfe65 100644 --- a/client/coral-framework/components/Slot.js +++ b/client/coral-framework/components/Slot.js @@ -1,13 +1,14 @@ import React, {Component} from 'react'; import {getSlotElements} from 'coral-framework/helpers/plugins'; +import styles from './Slot.css'; class Slot extends Component { render() { - const {fill, ...rest} = this.props; + const {fill, inline = false, ...rest} = this.props; return ( - +
{getSlotElements(fill, rest)} - +
); } } diff --git a/client/coral-framework/graphql/mutations/index.js b/client/coral-framework/graphql/mutations/index.js index da1603f9e..4a3abb48e 100644 --- a/client/coral-framework/graphql/mutations/index.js +++ b/client/coral-framework/graphql/mutations/index.js @@ -20,12 +20,11 @@ export const postComment = graphql(POST_COMMENT, { fragments: commentView }), props: ({ownProps, mutate}) => ({ - postItem: ({asset_id, body, parent_id}) => - mutate({ + postItem: comment => { + const {asset_id, body, parent_id, tags = []} = comment; + return mutate({ variables: { - asset_id, - body, - parent_id + comment }, optimisticResponse: { createComment: { @@ -39,14 +38,14 @@ export const postComment = graphql(POST_COMMENT, { parent_id, asset_id, action_summaries: [], - tags: [], + tags, status: null, id: 'pending' } } }, updateQueries: { - AssetQuery: (oldData, {mutationResult:{data:{createComment:{comment}}}}) => { + AssetQuery: (oldData, {mutationResult: {data: {createComment: {comment}}}}) => { if (oldData.asset.settings.moderation === 'PRE' || comment.status === 'PREMOD' || comment.status === 'REJECTED') { return oldData; @@ -62,8 +61,8 @@ export const postComment = graphql(POST_COMMENT, { ...oldData.asset, comments: oldData.asset.comments.map((oldComment) => { return oldComment.id === parent_id - ? {...oldComment, replies: [...oldComment.replies, comment]} - : oldComment; + ? {...oldComment, replies: [...oldComment.replies, comment]} + : oldComment; }) } }; @@ -83,7 +82,8 @@ export const postComment = graphql(POST_COMMENT, { return updatedAsset; } } - }) + }); + } }), }); diff --git a/client/coral-framework/graphql/mutations/postComment.graphql b/client/coral-framework/graphql/mutations/postComment.graphql index 110ab4b4e..f98558804 100644 --- a/client/coral-framework/graphql/mutations/postComment.graphql +++ b/client/coral-framework/graphql/mutations/postComment.graphql @@ -1,7 +1,7 @@ #import "../fragments/commentView.graphql" -mutation CreateComment ($asset_id: ID!, $parent_id: ID, $body: String!) { - createComment(asset_id:$asset_id, parent_id:$parent_id, body:$body) { +mutation CreateComment ($comment: CreateCommentInput!) { + createComment(comment: $comment) { comment { ...commentView replyCount diff --git a/client/coral-framework/reducers/index.js b/client/coral-framework/reducers/index.js index fae7e60d5..d5b66bbae 100644 --- a/client/coral-framework/reducers/index.js +++ b/client/coral-framework/reducers/index.js @@ -1,11 +1,13 @@ import auth from './auth'; import user from './user'; import asset from './asset'; +import {reducer as commentBox} from '../../coral-plugin-commentbox'; import {pluginReducers} from '../helpers/plugins'; export default { auth, user, asset, + commentBox, ...pluginReducers }; diff --git a/client/coral-plugin-commentbox/CommentBox.js b/client/coral-plugin-commentbox/CommentBox.js index 19472ef70..f395b56c9 100644 --- a/client/coral-plugin-commentbox/CommentBox.js +++ b/client/coral-plugin-commentbox/CommentBox.js @@ -2,56 +2,57 @@ import React, {Component, PropTypes} from 'react'; import {I18n} from '../coral-framework'; import translations from './translations.json'; import {Button} from 'coral-ui'; +import {Slot} from 'coral-framework'; +import {connect} from 'react-redux'; const name = 'coral-plugin-commentbox'; class CommentBox extends Component { - static propTypes = { - commentPostedHandler: PropTypes.func, - postItem: PropTypes.func.isRequired, - cancelButtonClicked: PropTypes.func, - assetId: PropTypes.string.isRequired, - parentId: PropTypes.string, - authorId: PropTypes.string.isRequired, - isReply: PropTypes.bool.isRequired, - canPost: PropTypes.bool, - currentUser: PropTypes.object - } + constructor(props) { + super(props); - state = { - body: '', - username: '' + this.state = { + username: '', + body: '', + hooks: { + preSubmit: [], + postSubmit: [] + } + }; } postComment = () => { const { - commentPostedHandler, - postItem, - assetId, - updateCountCache, isReply, - countCache, + assetId, parentId, + postItem, + countCache, addNotification, - authorId + updateCountCache, + commentPostedHandler } = this.props; let comment = { - body: this.state.body, asset_id: assetId, - author_id: authorId, - parent_id: parentId + parent_id: parentId, + body: this.state.body, + ...this.props.commentBox }; - if (this.props.charCount && this.state.body.length > this.props.charCount) { - return; - } !isReply && updateCountCache(assetId, countCache + 1); + + // Execute preSubmit Hooks + this.state.hooks.preSubmit.forEach(hook => hook()); + postItem(comment, 'comments') .then(({data}) => { const postedComment = data.createComment.comment; + // Execute postSubmit Hooks + this.state.hooks.postSubmit.forEach(hook => hook(data)); + if (postedComment.status === 'REJECTED') { addNotification('error', lang.t('comment-post-banned-word')); !isReply && updateCountCache(assetId, countCache); @@ -64,14 +65,67 @@ class CommentBox extends Component { commentPostedHandler(); } }) - .catch((err) => console.error(err)); + .catch((err) => console.error(err)); + this.setState({body: ''}); } + registerHook = (hookType = '', hook = () => {}) => { + if (typeof hook !== 'function') { + return console.warn(`Hooks must be functions. Please check your ${hookType} hooks`); + } else if (typeof hookType === 'string') { + this.setState(state => ({ + hooks: { + ...state.hooks, + [hookType]: [ + ...state.hooks[hookType], + hook + ] + } + })); + + return { + hookType, + hook + }; + + } else { + return console.warn('hookTypes must be a string. Please check your hooks'); + } + } + + unregisterHook = hookData => { + const {hookType, hook} = hookData; + + this.setState(state => { + let newHooks = state.hooks[newHooks]; + const idx = state.hooks[hookType].indexOf(hook); + + if (idx !== -1) { + newHooks = [ + ...state.hooks[hookType].slice(0, idx), + ...state.hooks[hookType].slice(idx + 1) + ]; + } + + return { + hooks: { + ...state.hooks, + [hookType]: newHooks + } + }; + + }); + } + + handleChange = e => this.setState({body: e.target.value}); + render () { const {styles, isReply, authorId, charCount} = this.props; let {cancelButtonClicked} = this.props; + const length = this.state.body.length; + const enablePostComment = !length || (charCount && length > charCount); if (isReply && typeof cancelButtonClicked !== 'function') { console.warn('the CommentBox component should have a cancelButtonClicked callback defined if it lives in a Reply'); @@ -93,33 +147,35 @@ class CommentBox extends Component { value={this.state.body} placeholder={lang.t('comment')} id={isReply ? 'replyText' : 'commentText'} - onChange={(e) => this.setState({body: e.target.value})} + onChange={this.handleChange} rows={3}/>
charCount ? `${name}-char-max` : ''}`}> - { - charCount && - `${charCount - length} ${lang.t('characters-remaining')}` - } + {charCount && `${charCount - length} ${lang.t('characters-remaining')}`}
+ { isReply && ( ) } { authorId && ( ) @@ -129,6 +185,20 @@ class CommentBox extends Component { } } -export default CommentBox; +CommentBox.propTypes = { + commentPostedHandler: PropTypes.func, + postItem: PropTypes.func.isRequired, + cancelButtonClicked: PropTypes.func, + assetId: PropTypes.string.isRequired, + parentId: PropTypes.string, + authorId: PropTypes.string.isRequired, + isReply: PropTypes.bool.isRequired, + canPost: PropTypes.bool, + currentUser: PropTypes.object +}; + +const mapStateToProps = ({commentBox}) => ({commentBox}); + +export default connect(mapStateToProps, null)(CommentBox); const lang = new I18n(translations); diff --git a/client/coral-plugin-commentbox/actions.js b/client/coral-plugin-commentbox/actions.js new file mode 100644 index 000000000..46bcf4b1b --- /dev/null +++ b/client/coral-plugin-commentbox/actions.js @@ -0,0 +1,9 @@ +export const addTag = tag => ({ + type: 'ADD_TAG', + tag +}); + +export const removeTag = idx => ({ + type: 'REMOVE_TAG', + idx +}); diff --git a/client/coral-plugin-commentbox/constants.js b/client/coral-plugin-commentbox/constants.js new file mode 100644 index 000000000..b1290f02e --- /dev/null +++ b/client/coral-plugin-commentbox/constants.js @@ -0,0 +1,2 @@ +export const ADD_TAG = 'ADD_TAG'; +export const REMOVE_TAG = 'REMOVE_TAG'; diff --git a/client/coral-plugin-commentbox/index.js b/client/coral-plugin-commentbox/index.js new file mode 100644 index 000000000..9f166caeb --- /dev/null +++ b/client/coral-plugin-commentbox/index.js @@ -0,0 +1,5 @@ +import reducer from './reducer'; + +export default { + reducer +}; diff --git a/client/coral-plugin-commentbox/reducer.js b/client/coral-plugin-commentbox/reducer.js new file mode 100644 index 000000000..d9065fe87 --- /dev/null +++ b/client/coral-plugin-commentbox/reducer.js @@ -0,0 +1,25 @@ +import {ADD_TAG, REMOVE_TAG} from './constants'; + +const initialState = { + tags: [] +}; + +export default function commentBox (state = initialState, action) { + switch (action.type) { + case ADD_TAG : + return { + ...state, + tags: [...state.tags, action.tag] + }; + case REMOVE_TAG : + return { + ...state, + tags: [ + ...state.tags.slice(0, action.idx), + ...state.tags.slice(action.idx + 1) + ] + }; + default : + return state; + } +} diff --git a/client/coral-plugin-commentbox/styles.css b/client/coral-plugin-commentbox/styles.css new file mode 100644 index 000000000..d0f851f18 --- /dev/null +++ b/client/coral-plugin-commentbox/styles.css @@ -0,0 +1,6 @@ +.slot { + display: inline-block; + div { + display: inline-block; + } +} diff --git a/graph/mutators/comment.js b/graph/mutators/comment.js index 728603ae2..982f7ade7 100644 --- a/graph/mutators/comment.js +++ b/graph/mutators/comment.js @@ -16,11 +16,14 @@ const Wordlist = require('../../services/wordlist'); * @param {String} [status='NONE'] the status of the new comment * @return {Promise} resolves to the created comment */ -const createComment = ({user, loaders: {Comments}}, {body, asset_id, parent_id = null}, status = 'NONE') => { +const createComment = ({user, loaders: {Comments}}, {body, asset_id, parent_id = null, tags = []}, status = 'NONE') => { - let tags = []; + // Building array of tags + tags = tags.map(tag => ({name: tag})); + + // If admin or moderator, adding STAFF tag if (user.hasRoles('ADMIN') || user.hasRoles('MODERATOR')) { - tags = [{name: 'STAFF'}]; + tags.push({name: 'STAFF'}); } return CommentsService.publicCreate({ diff --git a/graph/resolvers/root_mutation.js b/graph/resolvers/root_mutation.js index 38183bff6..661cc9f96 100644 --- a/graph/resolvers/root_mutation.js +++ b/graph/resolvers/root_mutation.js @@ -2,8 +2,8 @@ const wrapResponse = require('../helpers/response'); const CommentsService = require('../../services/comments'); const RootMutation = { - createComment(_, {asset_id, parent_id, body}, {mutators: {Comment}}) { - return wrapResponse('comment')(Comment.create({asset_id, parent_id, body})); + createComment(_, {comment}, {mutators: {Comment}}) { + return wrapResponse('comment')(Comment.create(comment)); }, createLike(_, {like: {item_id, item_type}}, {mutators: {Action}}) { return wrapResponse('like')(Action.create({item_id, item_type, action_type: 'LIKE'})); diff --git a/graph/typeDefs.graphql b/graph/typeDefs.graphql index ef6ff5937..0a067b49c 100644 --- a/graph/typeDefs.graphql +++ b/graph/typeDefs.graphql @@ -602,6 +602,26 @@ input CreateLikeInput { item_type: ACTION_ITEM_TYPE! } +enum TAG_TYPE { + STAFF +} + +input CreateCommentInput { + + # The asset id + asset_id: ID! + + # The id of the parent comment + parent_id: ID + + # The body of the comment + body: String! + + # Tags + tags: [TAG_TYPE] + +} + type CreateLikeResponse implements Response { # The like that was created. @@ -728,7 +748,7 @@ type StopIgnoringUserResponse implements Response { type RootMutation { # Creates a comment on the asset. - createComment(asset_id: ID!, parent_id: ID, body: String!): CreateCommentResponse + createComment(comment: CreateCommentInput!): CreateCommentResponse # Creates a like on an entity. createLike(like: CreateLikeInput!): CreateLikeResponse diff --git a/out.gif b/out.gif new file mode 100644 index 000000000..e69de29bb diff --git a/plugins/coral-plugin-offtopic/client/.babelrc b/plugins/coral-plugin-offtopic/client/.babelrc new file mode 100644 index 000000000..60be246eb --- /dev/null +++ b/plugins/coral-plugin-offtopic/client/.babelrc @@ -0,0 +1,14 @@ +{ + "presets": [ + "es2015" + ], + "plugins": [ + "add-module-exports", + "transform-class-properties", + "transform-decorators-legacy", + "transform-object-assign", + "transform-object-rest-spread", + "transform-async-to-generator", + "transform-react-jsx" + ] +} \ No newline at end of file diff --git a/plugins/coral-plugin-offtopic/client/.eslintrc.json b/plugins/coral-plugin-offtopic/client/.eslintrc.json new file mode 100644 index 000000000..9fe56bd14 --- /dev/null +++ b/plugins/coral-plugin-offtopic/client/.eslintrc.json @@ -0,0 +1,23 @@ +{ + "env": { + "browser": true, + "es6": true, + "mocha": true + }, + "parserOptions": { + "sourceType": "module", + "ecmaFeatures": { + "experimentalObjectRestSpread": true, + "jsx": true + } + }, + "parser": "babel-eslint", + "plugins": [ + "react" + ], + "rules": { + "react/jsx-uses-react": "error", + "react/jsx-uses-vars": "error", + "no-console": ["warn", { "allow": ["warn", "error"] }] + } +} diff --git a/plugins/coral-plugin-offtopic/client/components/OffTopicCheckbox.js b/plugins/coral-plugin-offtopic/client/components/OffTopicCheckbox.js new file mode 100644 index 000000000..4e7ef7adf --- /dev/null +++ b/plugins/coral-plugin-offtopic/client/components/OffTopicCheckbox.js @@ -0,0 +1,38 @@ +import React from 'react'; +import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; +import {addTag, removeTag} from 'coral-plugin-commentbox/actions'; +import styles from './styles.css'; + +class OffTopicCheckbox extends React.Component { + + label = 'OFF_TOPIC'; + + handleChange = (e) => { + if (e.target.checked) { + this.props.addTag(this.label) + } else { + const idx = this.props.commentBox.tags.indexOf(this.label); + this.props.removeTag(idx); + } + } + + render() { + return ( +
+ +
+ ) + } +} + + +const mapStateToProps = ({commentBox}) => ({commentBox}); + +const mapDispatchToProps = dispatch => + bindActionCreators({addTag, removeTag}, dispatch); + +export default connect(mapStateToProps, mapDispatchToProps)(OffTopicCheckbox); diff --git a/plugins/coral-plugin-offtopic/client/components/OffTopicTag.js b/plugins/coral-plugin-offtopic/client/components/OffTopicTag.js new file mode 100644 index 000000000..73e2372ed --- /dev/null +++ b/plugins/coral-plugin-offtopic/client/components/OffTopicTag.js @@ -0,0 +1,18 @@ +import React from 'react'; +import styles from './styles.css'; + +const isOffTopic = (tags) => { + return !!tags.filter(tag => tag.name === 'OFF_TOPIC').length +} + +export default (props) => ( + + { + isOffTopic(props.comment.tags) ? ( + + Off-topic + + ) : null + } + +); diff --git a/plugins/coral-plugin-offtopic/client/components/styles.css b/plugins/coral-plugin-offtopic/client/components/styles.css new file mode 100644 index 000000000..f3e290b09 --- /dev/null +++ b/plugins/coral-plugin-offtopic/client/components/styles.css @@ -0,0 +1,18 @@ +.offTopic { + height: 100%; +} + +.offTopicLabel { + padding: 10px 20px; + display: block; +} + +.tag { + background: rgba(245, 188, 168, 0.6); + display: inline-block; + margin: 0px 5px; + padding: 5px 5px; + border-radius: 2px; +} + + diff --git a/plugins/coral-plugin-offtopic/client/index.js b/plugins/coral-plugin-offtopic/client/index.js new file mode 100644 index 000000000..c006c9a9e --- /dev/null +++ b/plugins/coral-plugin-offtopic/client/index.js @@ -0,0 +1,9 @@ +import OffTopicCheckbox from './components/OffTopicCheckbox'; +import OffTopicTag from './components/OffTopicTag'; + +export default { + slots: { + commentBoxDetail: [OffTopicCheckbox], + commentInfoBar: [OffTopicTag] + } +}; diff --git a/plugins/coral-plugin-offtopic/index.js b/plugins/coral-plugin-offtopic/index.js new file mode 100644 index 000000000..51ad1c24e --- /dev/null +++ b/plugins/coral-plugin-offtopic/index.js @@ -0,0 +1,6 @@ +const {readFileSync} = require('fs'); +const path = require('path'); + +module.exports = { + typeDefs: readFileSync(path.join(__dirname, 'server/typeDefs.graphql'), 'utf8') +}; diff --git a/plugins/coral-plugin-offtopic/server/typeDefs.graphql b/plugins/coral-plugin-offtopic/server/typeDefs.graphql new file mode 100644 index 000000000..48ba577cf --- /dev/null +++ b/plugins/coral-plugin-offtopic/server/typeDefs.graphql @@ -0,0 +1,4 @@ +## Extending TAG_TYPE by adding OFF_TOPIC Tag +enum TAG_TYPE { + OFF_TOPIC +} diff --git a/plugins/coral-plugin-respect/client/index.js b/plugins/coral-plugin-respect/client/index.js index 2caa6611b..a336786d6 100644 --- a/plugins/coral-plugin-respect/client/index.js +++ b/plugins/coral-plugin-respect/client/index.js @@ -1,4 +1,5 @@ import RespectButton from './containers/RespectButton'; + export default { slots: { commentDetail: [RespectButton], diff --git a/services/comments.js b/services/comments.js index 75b53873a..7e9cca20f 100644 --- a/services/comments.js +++ b/services/comments.js @@ -3,10 +3,10 @@ const CommentModel = require('../models/comment'); const ActionModel = require('../models/action'); const ActionsService = require('./actions'); -const ALLOWED_TAGS = [ - {name: 'STAFF'}, - {name: 'BEST'}, -]; +// const ALLOWED_TAGS = [ +// {name: 'STAFF'}, +// {name: 'BEST'}, +// ]; const STATUSES = [ 'ACCEPTED', @@ -53,9 +53,10 @@ module.exports = class CommentsService { */ static addTag(id, name, assigned_by) { - if (ALLOWED_TAGS.find((t) => t.name === name) == null) { - return Promise.reject(new Error('tag not allowed')); - } + // Disabling allowed tags until we are able to extend them + // if (ALLOWED_TAGS.find((t) => t.name === name) == null) { + // return Promise.reject(new Error('tag not allowed')); + // } const filter = { id, diff --git a/test/server/graph/mutations/createComment.js b/test/server/graph/mutations/createComment.js index b3bdd459a..cf8481094 100644 --- a/test/server/graph/mutations/createComment.js +++ b/test/server/graph/mutations/createComment.js @@ -12,8 +12,8 @@ describe('graph.mutations.createComment', () => { beforeEach(() => SettingsService.init()); const query = ` - mutation CreateComment($body: String = "Here's my comment!") { - createComment(asset_id: "123", body: $body) { + mutation CreateComment($comment: CreateCommentInput = {asset_id: 123, body: "Here's my comment!"}) { + createComment(comment: $comment) { comment { id status @@ -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; diff --git a/test/graph/mutations/ignoreUser.js b/test/server/graph/mutations/ignoreUser.js similarity index 93% rename from test/graph/mutations/ignoreUser.js rename to test/server/graph/mutations/ignoreUser.js index c5633bfb4..54d6305a1 100644 --- a/test/graph/mutations/ignoreUser.js +++ b/test/server/graph/mutations/ignoreUser.js @@ -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, {}); diff --git a/test/graph/queries/asset.js b/test/server/graph/queries/asset.js similarity index 88% rename from test/graph/queries/asset.js rename to test/server/graph/queries/asset.js index ba31fe330..79abeda0e 100644 --- a/test/graph/queries/asset.js +++ b/test/server/graph/queries/asset.js @@ -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); }); });