Skip to content

Commit

Permalink
Test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
RoyEJohnson committed Feb 28, 2025
1 parent 5b913ef commit f20b574
Show file tree
Hide file tree
Showing 3 changed files with 716 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/helpers/fetch-mocker.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import errataResources from '../src/data/errata-resources';
import flags from '../src/data/flags';
import footerData from '../src/data/footer';
import formHeadings from '../src/data/form-headings';
import impact from '../src/data/impact';
import institutionalPartnershipData from '../src/data/institutional-partnership';
import kineticData from '../src/data/kinetic';
import newSubjectsData from '../src/data/new-subjects';
Expand Down Expand Up @@ -71,6 +72,7 @@ global.fetch = jest.fn().mockImplementation((...args) => {
const isFooter = (/api\/footer/).test(args[0]);
const isFormHeading = (/form-headings/).test(args[0]);
const isGiveBanner = args[0].endsWith('snippets/givebanner/');
const isImpact = args[0].includes('/pages/impact');
const isInstitutionalPartnership = (/pages\/institutional-partners/).test(args[0]);
const isKinetic = args[0].endsWith('kinetic/');
const isHomepage = (/openstax-homepage/).test(args[0]);
Expand Down Expand Up @@ -139,6 +141,8 @@ global.fetch = jest.fn().mockImplementation((...args) => {
payload = {};
} else if (isHomepage) {
payload = openstaxHomepageData;
} else if (isImpact) {
payload = impact;
} else if (isInstitutionalPartnership) {
payload = institutionalPartnershipData;
} else if (isKinetic) {
Expand Down
Loading

0 comments on commit f20b574

Please sign in to comment.