Skip to content

Commit

Permalink
Merge pull request #2530 from lmcnulty/checklists-test-trash-button-o…
Browse files Browse the repository at this point in the history
…n-risk

Checklists – Test deleting manual risk
  • Loading branch information
kepae authored Jan 8, 2024
2 parents b631943 + 54cc0e6 commit c9ce15a
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions site/gatsby-site/cypress/e2e/integration/apps/checklistsForm.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,37 @@ describe('Checklists App Form', () => {
cy.visit(url);
});
});

it('Should remove a manually-created risk', () => {
withLogin(({ user }) => {
interceptFindChecklist({
...defaultChecklist,
owner_id: user.userId,
risks: [
{
__typename: 'ChecklistRisk',
generated: false,
id: '5bb31fa6-2d32-4a01-b0a0-fa3fb4ec4b7d',
likelihood: '',
precedents: [],
risk_notes: '',
risk_status: 'Mitigated',
severity: '',
tags: ['GMF:Known AI Goal:Content Search'],
title: 'Manual Test Risk',
touched: false,
},
],
});
interceptUpsertChecklist({ ...defaultChecklist, owner_id: user.userId });

cy.visit(url);

cy.contains('Manual Test Risk').get('svg > title').contains('Delete Risk').parent().click();

cy.wait('@upsertChecklist');

cy.contains('Manual Test Risk').should('not.exist');
});
});
});

0 comments on commit c9ce15a

Please sign in to comment.