diff --git a/backend/src/schema/resolvers/users.js b/backend/src/schema/resolvers/users.js index 74561c5fe..4710942b6 100644 --- a/backend/src/schema/resolvers/users.js +++ b/backend/src/schema/resolvers/users.js @@ -151,7 +151,6 @@ export default { friendsCount: '<-[:FRIENDS]->(related:User)', followingCount: '-[:FOLLOWS]->(related:User)', followedByCount: '<-[:FOLLOWS]-(related:User)', - commentsCount: '-[:WROTE]->(r:Comment)', commentedCount: '-[:WROTE]->(:Comment)-[:COMMENTS]->(related:Post)', shoutedCount: '-[:SHOUTED]->(related:Post)', badgesCount: '<-[:REWARDED]-(related:Badge)', diff --git a/backend/src/schema/types/type/Post.gql b/backend/src/schema/types/type/Post.gql index 519af14ae..cbbcddfc9 100644 --- a/backend/src/schema/types/type/Post.gql +++ b/backend/src/schema/types/type/Post.gql @@ -29,11 +29,6 @@ type Post { categories: [Category]! @relation(name: "CATEGORIZED", direction: "OUT") comments: [Comment]! @relation(name: "COMMENTS", direction: "IN") - commentsCount: Int! - @cypher( - statement: "MATCH (this)<-[:COMMENTS]-(r:Comment) WHERE NOT r.deleted = true AND NOT r.disabled = true RETURN COUNT(r)" - ) - shoutedBy: [User]! @relation(name: "SHOUTED", direction: "IN") shoutedCount: Int! @cypher( diff --git a/backend/src/schema/types/type/User.gql b/backend/src/schema/types/type/User.gql index e3e8f8450..46e699410 100644 --- a/backend/src/schema/types/type/User.gql +++ b/backend/src/schema/types/type/User.gql @@ -64,7 +64,6 @@ type User { ) comments: [Comment]! @relation(name: "WROTE", direction: "OUT") - commentsCount: Int! @cypher(statement: "MATCH (this)-[:WROTE]->(r:Comment) WHERE NOT r.deleted = true AND NOT r.disabled = true RETURN COUNT(r)") commentedCount: Int! @cypher(statement: "MATCH (this)-[:WROTE]->(r:Comment)-[:COMMENTS]->(p:Post) WHERE NOT r.deleted = true AND NOT r.disabled = true AND NOT p.deleted = true AND NOT p.disabled = true RETURN COUNT(DISTINCT(p))") shouted: [Post]! @relation(name: "SHOUTED", direction: "OUT") @@ -143,7 +142,6 @@ type Query { followedByCount: Int followedByCurrentUser: Boolean contributionsCount: Int - commentsCount: Int commentedCount: Int shoutedCount: Int badgesCount: Int diff --git a/cypress/integration/common/steps.js b/cypress/integration/common/steps.js index 4abade0fa..608f6468d 100644 --- a/cypress/integration/common/steps.js +++ b/cypress/integration/common/steps.js @@ -260,7 +260,7 @@ Then("the first post on the landing page has the title:", title => { Then( "the page {string} returns a 404 error with a message:", (route, message) => { - // TODO: how can we check HTTP codes with cypress? + cy.request({ url: route, failOnStatusCode: false }).its('status').should('eq', 404) cy.visit(route, { failOnStatusCode: false }); cy.get(".error").should("contain", message); } diff --git a/webapp/components/Comment.vue b/webapp/components/Comment.vue index 9096fb6e8..c53d0a231 100644 --- a/webapp/components/Comment.vue +++ b/webapp/components/Comment.vue @@ -67,7 +67,7 @@ import { mapGetters, mapMutations } from 'vuex' import HcUser from '~/components/User' import ContentMenu from '~/components/ContentMenu' import ContentViewer from '~/components/Editor/ContentViewer' -import HcEditCommentForm from '~/components/comments/EditCommentForm/EditCommentForm' +import HcEditCommentForm from '~/components/EditCommentForm/EditCommentForm' export default { data: function() { diff --git a/webapp/components/comments/CommentForm/spec.js b/webapp/components/CommentForm/CommentForm.spec.js similarity index 98% rename from webapp/components/comments/CommentForm/spec.js rename to webapp/components/CommentForm/CommentForm.spec.js index 2d212c91d..5e7c952af 100644 --- a/webapp/components/comments/CommentForm/spec.js +++ b/webapp/components/CommentForm/CommentForm.spec.js @@ -1,5 +1,5 @@ import { mount, createLocalVue } from '@vue/test-utils' -import CommentForm from './index.vue' +import CommentForm from './CommentForm' import Styleguide from '@human-connection/styleguide' import Vuex from 'vuex' import MutationObserver from 'mutation-observer' diff --git a/webapp/components/comments/CommentForm/index.vue b/webapp/components/CommentForm/CommentForm.vue similarity index 84% rename from webapp/components/comments/CommentForm/index.vue rename to webapp/components/CommentForm/CommentForm.vue index e0e0058e5..795727578 100644 --- a/webapp/components/comments/CommentForm/index.vue +++ b/webapp/components/CommentForm/CommentForm.vue @@ -24,10 +24,10 @@ diff --git a/webapp/components/DeleteData/DeleteData.spec.js b/webapp/components/DeleteData/DeleteData.spec.js index 139316ed2..73ca985fa 100644 --- a/webapp/components/DeleteData/DeleteData.spec.js +++ b/webapp/components/DeleteData/DeleteData.spec.js @@ -48,7 +48,7 @@ describe('DeleteData.vue', () => { } getters = { 'auth/user': () => { - return { id: 'u343', name: deleteAccountName, contributionsCount: 2, commentsCount: 3 } + return { id: 'u343', name: deleteAccountName, contributionsCount: 2, commentedCount: 3 } }, } actions = { 'auth/logout': jest.fn() } diff --git a/webapp/components/DeleteData/DeleteData.vue b/webapp/components/DeleteData/DeleteData.vue index 293e65221..f6e6d47f0 100644 --- a/webapp/components/DeleteData/DeleteData.vue +++ b/webapp/components/DeleteData/DeleteData.vue @@ -30,12 +30,12 @@ }} -