Skip to content

Commit

Permalink
Add test for Rollbar logging on the website (#2320)
Browse files Browse the repository at this point in the history
* Add test for Rollbar logging on the website

* Move `rollbar.cy.js` test file to `integration` folder
  • Loading branch information
pdcp1 authored Sep 29, 2023
1 parent e02cc15 commit 9d5a8a3
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions site/gatsby-site/cypress/e2e/integration/rollbar.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
describe('Rollbar', () => {
it('Should log an error to Rollbar', () => {
cy.intercept('POST', 'https://api.rollbar.com/api/1/item/').as('rollbarAPICall');

cy.visit('/login');

cy.get('input[name=email]').type(Cypress.env('e2eUsername'));

cy.get('input[name=password]').type('invalidPassword');

cy.get('[data-cy="login-btn"]').click();

cy.wait('@rollbarAPICall').then((interception) => {
expect(interception.response.statusCode).to.equal(200);
expect(interception.response.statusMessage).to.equal('OK');
expect(interception.response.body.err).to.equal(0);
});
});
});

0 comments on commit 9d5a8a3

Please sign in to comment.