Files
freeCodeCamp/cypress/e2e/default/user/report-user.ts
Muhammed Mustafa 2ccf52e6bc feat: replace form components (#51204)
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
Co-authored-by: Huyen Nguyen <25715018+huyenltnguyen@users.noreply.github.com>
2023-10-15 19:33:39 -07:00

22 lines
887 B
TypeScript

describe('Report User', () => {
beforeEach(() => {
cy.task('seed');
cy.login();
});
it('should be possible to report a user from their profile page', () => {
// Since going to a user page initially generates a 404, we have to ignore
// status codes on that request
cy.visit('/twaha', { failOnStatusCode: false });
// The following line is only required if you want to test it in development
// cy.contains('Preview custom 404 page').click();
cy.contains("Flag This User's Account for Abuse").click();
cy.contains("Do you want to report twaha's portfolio for abuse?");
cy.get('[data-cy="report-user"]').type('Some details');
cy.contains('Submit the report').click();
cy.location().should(loc => {
expect(loc.pathname).to.eq('/learn');
});
cy.contains('A report was sent to the team with foo@bar.com in copy');
});
});