Skip to content

Commit

Permalink
Fix timing of intercept check
Browse files Browse the repository at this point in the history
  • Loading branch information
jordojordo committed Sep 23, 2024
1 parent ad6f23e commit fcf2a94
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions cypress/e2e/tests/pages/explorer/apps/charts.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,13 @@ describe('Apps/Charts', { tags: ['@explorer', '@adminUser'] }, () => {

chartPage.waitForPage();

// Set up intercept for the network request triggered by $fetch
cy.intercept('GET', '**/v1/catalog.cattle.io.clusterrepos/**').as('fetchChartData');

// Navigate back to the charts page
cy.go('back');
chartsPage.waitForPage();

// Verify that the network request was not made after navigating back
cy.get('@fetchChartData.all').should('have.length', 0);
// Set up intercept after navigating back
cy.intercept('GET', '**/v1/catalog.cattle.io.clusterrepos/**').as('fetchChartDataAfterBack');

cy.get('@fetchChartDataAfterBack.all').should('have.length', 0);
});
});

0 comments on commit fcf2a94

Please sign in to comment.