From 796cc40818f6eb82322c122819178414b30bbcf6 Mon Sep 17 00:00:00 2001 From: Clara Youdale Date: Mon, 5 Feb 2024 10:48:26 -0300 Subject: [PATCH] Add test to check that no orphan reports are displayed --- .../cypress/e2e/integration/submit.cy.js | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/site/gatsby-site/cypress/e2e/integration/submit.cy.js b/site/gatsby-site/cypress/e2e/integration/submit.cy.js index de216e4577..0e25ddee2a 100644 --- a/site/gatsby-site/cypress/e2e/integration/submit.cy.js +++ b/site/gatsby-site/cypress/e2e/integration/submit.cy.js @@ -892,6 +892,32 @@ describe('The Submit form', () => { cy.get('[data-cy=related-byText]').contains('Reports must have at least').should('exist'); }); + conditionalIt( + !Cypress.env('isEmptyEnvironment'), + 'Should *not* show related orphan reports', + () => { + cy.visit(url); + + const values = { + authors: 'Ashley Belanger', + }; + + for (const key in values) { + cy.get(`input[name="${key}"]`).type(values[key]); + } + + cy.clickOutside(); + + cy.get('[data-cy=related-byAuthors] [data-cy=result] a[data-cy=title]', { + timeout: 20000, + }).should( + 'not.contain', + 'Thousands scammed by AI voices mimicking loved ones in emergencies' + ); + cy.clickOutside(); + } + ); + it('Should show fallback preview image on initial load', () => { const values = { url: 'https://incidentdatabase.ai',