diff --git a/cypress/e2e/about-us/about-us-links.cy.ts b/cypress/e2e/about-us/about-us-links.cy.ts
new file mode 100644
index 000000000..0e9b306e7
--- /dev/null
+++ b/cypress/e2e/about-us/about-us-links.cy.ts
@@ -0,0 +1,130 @@
+describe('About Us Links interaction flow', () => {
+ beforeEach(() => {
+ cy.visit('/about-us/');
+ });
+
+ it('Navigates to the About Us page', () => {
+ cy.findAllByText('About Fiscal Data').should('exist');
+ });
+
+ it('Validates all links on the page function as intended', () => {
+ const links: object[] = [
+ {
+ name: 'Bureau of the Fiscal Service (Fiscal Service)',
+ url: 'https://fiscal.treasury.gov/about.html',
+ external: true,
+ },
+ {
+ name: 'getting started section',
+ url: 'api-documentation/#getting-started',
+ external: false,
+ },
+ {
+ name: 'International Monetary Fund (IMF)',
+ url: 'https://www.imf.org/en/home',
+ external: true,
+ },
+ {
+ name: 'Special Data Dissemination Standard (SDDS)',
+ url:
+ 'https://www.imf.org/en/About/Factsheets/Sheets/2023/Standards-for-data-dissemination#:~:text=The%20Special%20Data%20Dissemination%20System,access%20to%20international%20capital%20markets.',
+ external: true,
+ },
+ {
+ name: 'Monthly Statement of the Public Debt (MSPD)',
+ url: 'datasets/monthly-statement-public-debt/summary-of-treasury-securities-outstanding',
+ external: false,
+ },
+ {
+ name: 'Monthly Treasury Statement (MTS)',
+ url: 'datasets/monthly-treasury-statement/summary-of-receipts-outlays-and-the-deficit-surplus-of-the-u-s-government',
+ external: false,
+ },
+ {
+ name: 'IMF SDDS website',
+ url:
+ 'https://www.imf.org/en/About/Factsheets/Sheets/2023/Standards-for-data-dissemination#:~:text=The%20Special%20Data%20Dissemination%20System,access%20to%20international%20capital%20markets.',
+ external: true,
+ },
+ {
+ name: 'API Documentation',
+ url: 'api-documentation/',
+ external: false,
+ },
+ ];
+
+ links.forEach(link => {
+ if (link.external) {
+ cy.findByRole('link', { name: link.name }).should('have.attr', 'href', link.url);
+ } else {
+ cy.findByRole('link', { name: link.name }).click();
+ cy.url().should('include', link.url);
+ cy.visit('/about-us/');
+ }
+ });
+ });
+
+ it('Validates duplicate links', () => {
+ const duplicateLinks: object[] = [
+ {
+ name: 'visit their Contact Us page',
+ url: 'https://fiscal.treasury.gov/top/contact.html',
+ external: true,
+ },
+ {
+ name: 'Economic Impact Payments Page',
+ url: 'http://www.irs.gov/coronavirus-tax-relief-and-economic-impact-payments',
+ external: true,
+ },
+ {
+ name: "Where's My Refund?",
+ url: 'https://www.irs.gov/refunds',
+ external: true,
+ },
+ {
+ name: 'contact the Bureau of the Fiscal Service',
+ url: 'https://fiscal.treasury.gov/contact/',
+ external: true,
+ },
+ {
+ name: 'visit their Contact Us page',
+ url: 'https://fiscal.treasury.gov/top/contact.html',
+ external: true,
+ },
+ {
+ name: 'Economic Impact Payments Page',
+ url: 'http://www.irs.gov/coronavirus-tax-relief-and-economic-impact-payments',
+ external: true,
+ },
+ ];
+
+ duplicateLinks.forEach(link => {
+ const dupes = cy.findAllByRole('link', { name: link.name });
+
+ dupes.each(dupe => {
+ cy.wrap(dupe).should('have.attr', 'href', link.url);
+ });
+ });
+ });
+
+ it('Validates download links', () => {
+ const downloadLinks: object[] = [
+ {
+ name: 'Open Data Policy',
+ url: '/data/about-us/901-1 Open Data Policy.pdf',
+ },
+ {
+ name: 'https://fiscaldata.treasury.gov/static-data/reports-statements/mts/imf/cgd.xml',
+ url: 'https://fiscaldata.treasury.gov/static-data/reports-statements/mts/imf/cgd.xml',
+ },
+ {
+ name: 'https://fiscaldata.treasury.gov/static-data/reports-statements/mts/imf/cgo.xml',
+ url: 'https://fiscaldata.treasury.gov/static-data/reports-statements/mts/imf/cgo.xml',
+ },
+ ];
+
+ downloadLinks.forEach(link => {
+ cy.findByRole('link', { name: link.name }).should('have.attr', 'href', link.url);
+ });
+ });
+});
diff --git a/cypress/e2e/about-us/about-us-sub-nav.cy.ts b/cypress/e2e/about-us/about-us-sub-nav.cy.ts
new file mode 100644
index 000000000..8fc92e638
--- /dev/null
+++ b/cypress/e2e/about-us/about-us-sub-nav.cy.ts
@@ -0,0 +1,48 @@
+describe('About us interaction flow', () => {
+ beforeEach(() => {
+ cy.visit('/about-us/').wait(1500);
+ });
+
+ it('Verifies about us page loads', () => {
+ cy.findAllByText('About Fiscal Data').should('exist');
+ });
+ it('Verifies about us sub nav interaction flow FAQ', () => {
+ cy.findByTitle('Why do some datasets...')
+ .should('exist')
+ .click();
+ cy.url().should('include', '/#why-datasets-go-further-than-others');
+ });
+ it('Verifies keyboard interaction about us sub nav interaction flow FAQ', () => {
+ cy.findByTitle('I’m new to using APIs...')
+ .should('exist')
+ .focus()
+ .type('{enter}');
+ cy.url().should('include', '/#new-to-apis');
+ });
+ it('Verifies about us sub nav interaction flow About Fiscal Data', () => {
+ cy.findByTitle('Background')
+ .should('exist')
+ .click();
+ cy.url().should('include', '/#background');
+ });
+ it('Verifies keyboard interaction about us sub nav interaction flow About Fiscal Data', () => {
+ cy.findByTitle('Mission')
+ .should('exist')
+ .focus()
+ .type('{enter}');
+ cy.url().should('include', '/#mission');
+ });
+ it('Verifies about us sub nav interaction flow Contact Us', () => {
+ cy.findByTitle('Contact Us')
+ .should('exist')
+ .click();
+ cy.url().should('include', '/#contact-us');
+ });
+ it('Verifies keyboard interaction about us sub nav interaction flow About Contact Us', () => {
+ cy.findByTitle('Contact Us')
+ .should('exist')
+ .focus()
+ .type('{enter}');
+ cy.url().should('include', '/#contact-us');
+ });
+});
diff --git a/cypress/e2e/dataset-detail-page/ddp-related-dataset.cy.ts b/cypress/e2e/dataset-detail-page/ddp-related-dataset.cy.ts
new file mode 100644
index 000000000..00b862cf5
--- /dev/null
+++ b/cypress/e2e/dataset-detail-page/ddp-related-dataset.cy.ts
@@ -0,0 +1,20 @@
+describe('DDP related dataset go to the correct datasets', () => {
+ beforeEach(() => {
+ cy.visit('/datasets/monthly-treasury-statement/summary-of-receipts-outlays-and-the-deficit-surplus-of-the-u-s-government').wait(3000);
+ });
+ it('Validates the DDP page loads', () => {
+ cy.findByTitle('Monthly Treasury Statement (MTS)').should('be.visible');
+ cy.findAllByText('Debt to the Penny')
+ .eq(1)
+ .click();
+ cy.url().should('include', '/debt-to-the-penny');
+ cy.findAllByText('Daily Treasury Statement (DTS)')
+ .eq(1)
+ .click();
+ cy.url().should('include', '/daily-treasury-statement/operating-cash-balance');
+ cy.findAllByText('Monthly Treasury Statement (MTS)')
+ .eq(1)
+ .click();
+ cy.url().should('include', '/summary-of-receipts-outlays-and-the-deficit-surplus-of-the-u-s-government');
+ });
+});
diff --git a/cypress/e2e/glossary terms/glossary-terms.cy.ts b/cypress/e2e/glossary terms/glossary-terms.cy.ts
new file mode 100644
index 000000000..acc997684
--- /dev/null
+++ b/cypress/e2e/glossary terms/glossary-terms.cy.ts
@@ -0,0 +1,59 @@
+describe('Glossary terms interaction flow', () => {
+ beforeEach(() => {
+ cy.visit('/').wait(3000);
+ cy.findAllByText('Resources').click();
+ cy.findAllByText('Glossary')
+ .click()
+ .wait(3000);
+ });
+ it('Verifies Glossary opens and closes correctly', () => {
+ cy.findByText('Search the glossary').should('exist');
+ cy.findByLabelText('Close glossary').click();
+ cy.findByText('Search the glossary').should('not.exist');
+ });
+
+ it('Search bar search and Back to list interaction', () => {
+ cy.findAllByLabelText('Search the glossary').should('be.visible');
+ cy.findAllByLabelText('Search the glossary')
+ .eq(1)
+ .type('Revenue');
+ cy.findAllByText('Back to list')
+ .should('exist')
+ .click();
+ cy.findAllByLabelText('Search the glossary')
+ .eq(1)
+ .type('Debt Ceiling')
+ .click();
+ cy.findAllByText('Back to list')
+ .should('exist')
+ .click();
+ });
+ it('Search bar click into a selected search', () => {
+ cy.findAllByLabelText('Search the glossary')
+ .eq(1)
+ .type('Debt Ceiling');
+ cy.findAllByText('Debt Ceiling')
+ .should('exist')
+ .click();
+ cy.findAllByText(
+ 'This is the maximum amount of money the federal government is allowed to borrow without receiving additional authority from Congress.'
+ ).should('exist');
+ });
+ it('Search bar interaction with Floating Rate Notes and external link', () => {
+ cy.findAllByLabelText('Search the glossary')
+ .eq(1) // Target the correct search bar
+ .should('be.visible')
+ .type('Floating Rate Notes');
+ cy.findAllByText('Floating Rate Notes')
+ .should('exist')
+ .click();
+ cy.findAllByText('TreasuryDirect')
+ .should('exist')
+ .invoke('attr', 'href')
+ .should('include', '/marketable-securities/floating-rate-notes/');
+
+ cy.findAllByText('TreasuryDirect')
+ .invoke('removeAttr', 'target')
+ .click();
+ });
+});
diff --git a/src/components/anchor-text/anchor-text.tsx b/src/components/anchor-text/anchor-text.tsx
index bf9304ff5..9128d26c5 100644
--- a/src/components/anchor-text/anchor-text.tsx
+++ b/src/components/anchor-text/anchor-text.tsx
@@ -4,12 +4,19 @@ import CustomLink from '../links/custom-link/custom-link';
type IAnchorText = {
link: string;
text: string;
+ onAnchorClick?: (anchorId: string) => void;
};
-const AnchorText = ({ link, text }: IAnchorText): JSX.Element => {
+const AnchorText = ({ link, text, onAnchorClick }: IAnchorText): JSX.Element => {
+ const handleClick = () => {
+ if (onAnchorClick) {
+ onAnchorClick(link);
+ }
+ };
+
return (
-
For example, the API call for the sum total of the opening monthly balance within the Daily Treasury Statement dataset would read as:
-{baseApiUrl}/v1/accounting/dts/dts_table_2?fields=record_date,transaction_today_amt
+
+ {baseApiUrl}/v1/accounting/dts/deposits_withdrawals_operating_cash?fields=record_date,transaction_today_amt
+
Running this API call will yield a sum of all the totals in the selected field. In this case, the call yields the total sum of all opening
monthly balances over the course of all dates available in the dataset.
diff --git a/src/components/api-documentation/examples/examples.jsx b/src/components/api-documentation/examples/examples.jsx
index 9ed812ae7..2661a1bee 100644
--- a/src/components/api-documentation/examples/examples.jsx
+++ b/src/components/api-documentation/examples/examples.jsx
@@ -36,7 +36,7 @@ const Examples = () => {
{baseApiUrl}
/v1/accounting/od/rates_of_exchange?fields=country_currency_desc,exchange_rate,
- record_date&filter=country_currency_desc:in:(Canada-Dollar,Mexico-Peso), record_date:gte:2020-01-01
+ record_date&filter=country_currency_desc:in:(Canada-Dollar,Mexico-Peso),record_date:gte:2020-01-01
- {baseApiUrl}/v2/accounting/od/debt_to_penny?fields=record_calendar_year,
- record_calendar_month&sort=-record_calendar_year,-record_calendar_month
+ {baseApiUrl}
+ /v2/accounting/od/debt_to_penny?fields=record_calendar_year,record_calendar_month&sort=-record_calendar_year,-record_calendar_month
{baseApiUrl}/v1/debt/top/top_state?page[number]=10&page[size]=50
+
+
+ {baseApiUrl}/v1/accounting/dts/deposits_withdrawals_operating_cash?fields=record_date,transaction_type,transaction_today_amt
+
filter=
accepts filters from the list below, as well as
specified filter criteria. Use a colon at the end of a filter parameter to pass a value or list of values. For lists passed as filter
criteria, use a comma-separated list within parentheses. Filter for specific dates using the format YYYY-MM-DD
- .
+ . To filter by multiple fields in a single request, do not repeat a filter call. Instead, apply an additional field to include in the filter
+ separated by a comma, as shown in the following template: &filter=field:prm:value,field:prm:value
Required: No, filters are not required to make an API request. diff --git a/src/components/api-documentation/getting-started/getting-started.jsx b/src/components/api-documentation/getting-started/getting-started.jsx index c8100a3a3..64541e14e 100644 --- a/src/components/api-documentation/getting-started/getting-started.jsx +++ b/src/components/api-documentation/getting-started/getting-started.jsx @@ -88,7 +88,7 @@ const GettingStarted = () => {
{baseApiUrl}
- /v1/accounting/od/rates_of_exchange?fields=country_currency_desc,exchange_rate, record_date&filter=record_date:gte:2015-01-01
+ /v1/accounting/od/rates_of_exchange?fields=country_currency_desc,exchange_rate,record_date&filter=record_date:gte:2015-01-01
@@ -12,7 +30,13 @@ const LearnMore: FunctionComponent = () => {
called
+ This is some text referencing a footnote
+
The sale of U.S. Treasury marketable securities began with the nation’s founding, where private citizens purchased $27 million in government
bonds to finance the Revolutionary War.
-
diff --git a/src/layouts/explainer/sections/treasury-savings-bonds/savings-bonds-overview/savings-bonds-overview.tsx b/src/layouts/explainer/sections/treasury-savings-bonds/savings-bonds-overview/savings-bonds-overview.tsx
index cc427c43e..957ffd873 100644
--- a/src/layouts/explainer/sections/treasury-savings-bonds/savings-bonds-overview/savings-bonds-overview.tsx
+++ b/src/layouts/explainer/sections/treasury-savings-bonds/savings-bonds-overview/savings-bonds-overview.tsx
@@ -26,7 +26,7 @@ const SavingsBondsOverview: FunctionComponent = () => {
safe investment opportunity to ordinary Americans with the hope that by owning shares in their country, they may become more interested in
national policy.
-