From 64d970abd20bdf9ea4100cf0667cc5e96e922ebf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Jun 2022 15:16:07 +0100 Subject: [PATCH] Bump cypress from 9.6.1 to 9.7.0 (#17840) * Bump cypress from 9.6.1 to 9.7.0 Bumps [cypress](https://github.com/cypress-io/cypress) from 9.6.1 to 9.7.0. - [Release notes](https://github.com/cypress-io/cypress/releases) - [Changelog](https://github.com/cypress-io/cypress/blob/develop/.releaserc.base.js) - [Commits](https://github.com/cypress-io/cypress/compare/v9.6.1...v9.7.0) --- updated-dependencies: - dependency-name: cypress dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * update failing spec Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Suzanne Aitchison --- .../articleFlows/hideArticleComments.spec.js | 31 +++++++++++-------- package.json | 2 +- yarn.lock | 8 ++--- 3 files changed, 23 insertions(+), 18 deletions(-) diff --git a/cypress/integration/seededFlows/articleFlows/hideArticleComments.spec.js b/cypress/integration/seededFlows/articleFlows/hideArticleComments.spec.js index c7ac4e82b..2946fbf40 100644 --- a/cypress/integration/seededFlows/articleFlows/hideArticleComments.spec.js +++ b/cypress/integration/seededFlows/articleFlows/hideArticleComments.spec.js @@ -9,29 +9,34 @@ describe('Hiding/unhiding comments on an article', () => { }); describe('Admin visits the article authored by them', () => { - it('Hides a comment and then unhides it from the same screen', () => { + it('Allows a user to hide/unhide a comment', () => { cy.findByRole('button', { name: 'Toggle dropdown menu' }).click(); cy.findByRole('button', { name: "Hide Admin McAdmin's comment" }).click(); + + // Check we also expose the link to report abuse + cy.findByRole('link', { name: 'reporting abuse' }) + .should('have.attr', 'href') + .and('contains', `/admin_mcadmin/comment/`); + cy.findByRole('button', { name: 'Confirm' }).click(); - cy.findByRole('button', { name: 'Toggle dropdown menu' }).should( - 'not.be.visible', - ); + // Page reloads after confirm click - we check the new page references the hidden comment + cy.findByText( + /Some comments have been hidden by the post's author/, + ).should('exist'); + cy.findByRole('img', { name: 'Expand' }).click(); cy.findByRole('button', { name: 'Toggle dropdown menu' }).click(); cy.findByRole('link', { name: "Unhide Admin McAdmin's comment", }).click(); + + // Page reloads with no hidden comments + cy.findByText( + /Some comments have been hidden by the post's author/, + ).should('not.exist'); + cy.findByRole('img', { name: 'Expand' }).should('not.exist'); }); - - it('has report-abuse link when showing hiding comment modal', () => { - cy.findByRole('button', { name: 'Toggle dropdown menu' }).click(); - cy.findByRole('button', { name: "Hide Admin McAdmin's comment" }).click(); - - cy.findByRole('link', { name: 'reporting abuse' }) - .should('have.attr', 'href') - .and('contains', `/admin_mcadmin/comment/`); - }); }); }); diff --git a/package.json b/package.json index 6765ecb29..73041baff 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "babel-loader": "^8.2.5", "css-loader": "^5.2.7", "cssom": "^0.5.0", - "cypress": "^9.6.1", + "cypress": "^9.7.0", "cypress-failed-log": "^2.9.5", "cypress-file-upload": "^5.0.8", "cypress-pipe": "^2.0.0", diff --git a/yarn.lock b/yarn.lock index 60fda2cbd..4ec6e57ee 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6399,10 +6399,10 @@ cypress-pipe@^2.0.0: resolved "https://registry.yarnpkg.com/cypress-pipe/-/cypress-pipe-2.0.0.tgz#577df7a70a8603d89a96dfe4092a605962181af8" integrity sha512-KW9s+bz4tFLucH3rBGfjW+Q12n7S4QpUSSyxiGrgPOfoHlbYWzAGB3H26MO0VTojqf9NVvfd5Kt0MH5XMgbfyg== -cypress@^9.6.1: - version "9.6.1" - resolved "https://registry.yarnpkg.com/cypress/-/cypress-9.6.1.tgz#a7d6b5a53325b3dc4960181f5800a5ade0f085eb" - integrity sha512-ECzmV7pJSkk+NuAhEw6C3D+RIRATkSb2VAHXDY6qGZbca/F9mv5pPsj2LO6Ty6oIFVBTrwCyL9agl28MtJMe2g== +cypress@^9.7.0: + version "9.7.0" + resolved "https://registry.yarnpkg.com/cypress/-/cypress-9.7.0.tgz#bf55b2afd481f7a113ef5604aa8b693564b5e744" + integrity sha512-+1EE1nuuuwIt/N1KXRR2iWHU+OiIt7H28jJDyyI4tiUftId/DrXYEwoDa5+kH2pki1zxnA0r6HrUGHV5eLbF5Q== dependencies: "@cypress/request" "^2.88.10" "@cypress/xvfb" "^1.2.4"