Skip to content

Commit

Permalink
Add test to check that no orphan reports are displayed
Browse files Browse the repository at this point in the history
  • Loading branch information
clari182 committed Feb 5, 2024
1 parent d4ae2bf commit 796cc40
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions site/gatsby-site/cypress/e2e/integration/submit.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 796cc40

Please sign in to comment.