Skip to content

Commit

Permalink
test(cypress): improve intercept assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
mijogu committed Apr 27, 2023
1 parent 91c612b commit ee1394e
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions web/client/cypress/e2e/validator.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,30 @@ context('GTFS Validator - Core Workflow', () => {
.click();

// Wait for create job 200 response
cy.wait('@createJob').its('response.statusCode').should('eq', 200);
cy.wait('@createJob').should((xhr) => {
expect(xhr.response.statusCode).to.eq(200);
});

// Wait for 404
cy.wait('@awaitJob').its('response.statusCode').should('eq', 404);
cy.wait('@awaitJob').should((xhr) => {
expect(xhr.response.statusCode).to.eq(404);
expect(xhr.request.url).to.contain('_waiting_');
expect(xhr.request.url).to.not.contain(jobId);
});

// Wait for 404
cy.wait('@awaitJob').its('response.statusCode').should('eq', 404);
cy.wait('@awaitJob').should((xhr) => {
expect(xhr.response.statusCode).to.eq(404);
expect(xhr.request.url).to.contain(jobId);
expect(xhr.request.url).to.not.contain('_waiting_');
});

// Wait for 200
cy.wait('@awaitJob').its('response.statusCode').should('eq', 200);
cy.wait('@awaitJob').should((xhr) => {
expect(xhr.response.statusCode).to.eq(200);
expect(xhr.request.url).to.contain(jobId);
expect(xhr.request.url).to.not.contain('_waiting_');
});

// Confirm "report ready"
cy.get('dialog')
Expand Down

0 comments on commit ee1394e

Please sign in to comment.