Skip to content

Commit

Permalink
fix: broken top page
Browse files Browse the repository at this point in the history
  • Loading branch information
dadiorchen committed Aug 4, 2023
1 parent f335619 commit 8b1aaf7
Showing 1 changed file with 26 additions and 6 deletions.
32 changes: 26 additions & 6 deletions cypress/tests/integration/top.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('top', () => {
cy.task('nockIntercept', {
hostname: 'https://dev-k8s.treetracker.org',
method: 'get',
path: '/query/organizations/featured',
path: '/query/v2/organizations/featured',
statusCode: 200,
body: {
organizations: [organization1],
Expand All @@ -26,7 +26,7 @@ describe('top', () => {
cy.task('nockIntercept', {
hostname: 'https://dev-k8s.treetracker.org',
method: 'get',
path: '/query/planters/featured',
path: '/query/v2/planters/featured',
statusCode: 200,
body: {
planters: [planter940],
Expand All @@ -36,22 +36,42 @@ describe('top', () => {
cy.task('nockIntercept', {
hostname: 'https://dev-k8s.treetracker.org',
method: 'get',
path: '/query/wallets/featured',
path: '/query/v2/wallets/featured',
statusCode: 200,
body: {
wallets: [wallets],
},
});

cy.task('nockIntercept', {
hostname: 'https://dev-k8s.treetracker.org',
method: 'get',
path: '/query/v2/captures',
statusCode: 200,
body: {
captures: [
{ ...tree186734, id: '254fd088-b0aa-4eef-a3d9-b02c491ff9d3' },
],
},
});

cy.task('nockIntercept', {
hostname: 'https://dev-k8s.treetracker.org',
method: 'get',
path: '/query/v2/growers/featured',
statusCode: 200,
body: {
grower_accounts: [],
},
});

cy.intercept('GET', '**/countries/**', {
statusCode: 200,
body: leaders,
});

cy.visit('/top');
cy.contains('Featured trees');
cy.contains('Check out the global leaders in the tree planting effort');
cy.contains('Tanzania');
cy.contains('Featured captures');
cy.screenshot();
});
});

0 comments on commit 8b1aaf7

Please sign in to comment.