diff --git a/backend/src/schema/resolvers/posts.spec.js b/backend/src/schema/resolvers/posts.spec.js index c9da4d570..0f8d398c2 100644 --- a/backend/src/schema/resolvers/posts.spec.js +++ b/backend/src/schema/resolvers/posts.spec.js @@ -888,7 +888,7 @@ describe('UpdatePost', () => { describe('admin can unpin posts', () => { let admin, pinnedPost beforeEach(async () => { - pinnedPost = await neode.create('Post', { id: 'post-to-be-unpinned' }) + pinnedPost = await factory.create('Post', { id: 'post-to-be-unpinned' }) admin = await user.update({ role: 'admin', name: 'Admin', diff --git a/cypress/integration/common/report.js b/cypress/integration/common/report.js index c32d5e10a..cb29f114d 100644 --- a/cypress/integration/common/report.js +++ b/cypress/integration/common/report.js @@ -67,13 +67,11 @@ When('I click on the author', () => { }) When('I report the author', () => { - cy.get('.page-name-profile-id-slug').then(() => { - invokeReportOnElement('.ds-card').then(() => { - cy.get('button') - .contains('Send') - .click() - }) - }) + cy.get('.page-name-profile-id-slug') + invokeReportOnElement('.ds-card') + cy.get('button') + .contains('Send') + .click() }) When('I click on send in the confirmation dialog', () => { @@ -87,11 +85,10 @@ Then('I get a success message', () => { }) Then('I see my reported user', () => { - cy.get('table').then(() => { - cy.get('tbody tr') - .first() - .contains(lastReportTitle.trim()) - }) + cy.get('table') + cy.get('tbody tr') + .first() + .contains(lastReportTitle.trim()) }) Then(`I can't see the moderation menu item`, () => { diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 51ba950a6..51dcd2126 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -36,15 +36,8 @@ const authenticatedHeaders = async (variables) => { } Cypress.Commands.add("switchLanguage", (name, force) => { - const { code } = helpers.getLangByName(name); if (force) { switchLang(name); - } else { - cy.get("html").then($html => { - if ($html && $html.attr("lang") !== code) { - switchLang(name); - } - }); } }); diff --git a/webapp/pages/index.vue b/webapp/pages/index.vue index dab7bef00..eef45989a 100644 --- a/webapp/pages/index.vue +++ b/webapp/pages/index.vue @@ -178,7 +178,7 @@ export default { this.$apollo .mutate({ mutation: PostMutations().pinPost, - variables: { id: post.id, title: post.title, content: post.content, pinned: true }, + variables: { id: post.id }, }) .then(() => { this.$toast.success(this.$t('post.menu.pinnedSuccessfully')) @@ -191,7 +191,7 @@ export default { this.$apollo .mutate({ mutation: PostMutations().unpinPost, - variables: { id: post.id, title: post.title, content: post.content, unpinned: true }, + variables: { id: post.id }, }) .then(() => { this.$toast.success(this.$t('post.menu.unpinnedSuccessfully')) diff --git a/webapp/pages/post/_id/_slug/index.spec.js b/webapp/pages/post/_id/_slug/index.spec.js index e0fa6556a..cd483eaf8 100644 --- a/webapp/pages/post/_id/_slug/index.spec.js +++ b/webapp/pages/post/_id/_slug/index.spec.js @@ -44,6 +44,9 @@ describe('PostSlug', () => { $apollo: { mutate: jest.fn().mockResolvedValue(), }, + $route: { + hash: '', + }, } }) diff --git a/webapp/pages/post/_id/_slug/index.vue b/webapp/pages/post/_id/_slug/index.vue index e2de1d15e..987faf36d 100644 --- a/webapp/pages/post/_id/_slug/index.vue +++ b/webapp/pages/post/_id/_slug/index.vue @@ -171,8 +171,8 @@ export default { pinPost(post) { this.$apollo .mutate({ - mutation: PostMutations().UpdatePost, - variables: { id: post.id, title: post.title, content: post.content, pinned: true }, + mutation: PostMutations().pinPost, + variables: { id: post.id }, }) .then(() => { this.$toast.success(this.$t('post.menu.pinnedSuccessfully')) @@ -182,8 +182,8 @@ export default { unpinPost(post) { this.$apollo .mutate({ - mutation: PostMutations().UpdatePost, - variables: { id: post.id, title: post.title, content: post.content, unpinned: true }, + mutation: PostMutations().unpinPost, + variables: { id: post.id }, }) .then(() => { this.$toast.success(this.$t('post.menu.unpinnedSuccessfully'))