Skip to content

Commit dc3f22e

Browse files
committed
Merge branch 'master' into FDG-9447
2 parents c2699e8 + c265562 commit dc3f22e

File tree

6 files changed

+120
-7
lines changed

6 files changed

+120
-7
lines changed
Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
import React from 'react';
22
import Masthead from './masthead';
3-
import { render, within } from '@testing-library/react';
3+
import { fireEvent, render, within } from '@testing-library/react';
44

55
describe('Masthead component', () => {
66
it('displays the dataset name in an H1 element', () => {
77
const { getByRole } = render(<Masthead title="Debt to the Nickel" techSpecs={{}} tagLine="All the debt, to the nickel." />);
88
const titleDisplayed = getByRole('heading', { level: 1 }); // will fail if not exactly 1 <h1 />
99
expect(within(titleDisplayed).getByText('Debt to the Nickel')).toBeInTheDocument();
1010
});
11+
12+
it('applies stickyView class to the title once the position exceeds the breakpoint', () => {
13+
const { getByRole } = render(<Masthead title="Debt to the Nickel" />);
14+
window.pageYOffset = 150;
15+
fireEvent.scroll(window);
16+
const titleDisplayed = getByRole('heading', { level: 1 });
17+
expect(titleDisplayed).toHaveClass('stickyHeader');
18+
});
1119
});

src/components/site-footer/site-footer.jsx

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,20 @@ import {
1111
footerMain,
1212
logo,
1313
pageLinks,
14+
topRow,
15+
socialIcons,
16+
socialIconLink,
1417
} from './site-footer.module.scss';
1518
import globalConstants from '../../helpers/constants';
1619
import DownloadSticky from '../download-sticky/download-sticky';
1720
import ResumeDownloadModal from '../download-modal/resume-download-modal/resume-download-modal';
1821
import { StaticImage } from 'gatsby-plugin-image';
1922
import Analytics from '../../utils/analytics/analytics';
2023
import CustomLink from '../links/custom-link/custom-link';
24+
import LinkedInIcon from '@mui/icons-material/LinkedIn';
25+
import FacebookIcon from '@mui/icons-material/Facebook';
26+
import XIcon from '@mui/icons-material/X';
27+
import YouTubeIcon from '@mui/icons-material/YouTube';
2128

2229
export const siteFooterColumns = [
2330
{
@@ -99,6 +106,7 @@ const SiteFooter = () => {
99106
<footer>
100107
<div className={footerMain}>
101108
<div className={content}>
109+
<div className={topRow}>
102110
<Link data-testid="logo" className={logo} to="/" onClick={() => clickHandler('Logo')} aria-label={'Redirect to Fiscal Data homepage'}>
103111
<StaticImage
104112
src="../../images/logos/fd-logo-ko.svg"
@@ -110,6 +118,45 @@ const SiteFooter = () => {
110118
aria-label="Fiscal Data logo"
111119
/>
112120
</Link>
121+
<div className={socialIcons}>
122+
<a
123+
href="https://www.facebook.com/fiscalservice"
124+
target="_blank"
125+
rel="noopener noreferrer"
126+
aria-label="facebook"
127+
className={socialIconLink}
128+
>
129+
<FacebookIcon />
130+
</a>
131+
<a
132+
href="https://x.com/FiscalService"
133+
target="_blank"
134+
rel="noopener noreferrer"
135+
aria-label="x"
136+
className={ socialIconLink }
137+
>
138+
<XIcon fontSize="small" />
139+
</a>
140+
<a
141+
href="https://www.linkedin.com/company/1722850/"
142+
target="_blank"
143+
rel="noopener noreferrer"
144+
aria-label="linkedin"
145+
className={socialIconLink}
146+
>
147+
<LinkedInIcon />
148+
</a>
149+
<a
150+
href="https://www.youtube.com/channel/UCrezr4h8sW9zB6IEoKwBqRQ/videos"
151+
target="_blank"
152+
rel="noopener noreferrer"
153+
aria-label="youtube"
154+
className={ socialIconLink }
155+
>
156+
<YouTubeIcon />
157+
</a>
158+
</div>
159+
</div>
113160
<div className={pageLinks}>
114161
{siteFooterColumns.map(columnContent => {
115162
return (

src/components/site-footer/site-footer.module.scss

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,26 @@
88
z-index: $main-sticky-footer; // positioned to overlap sticky footer during its exit transition
99
}
1010

11+
.topRow {
12+
display: flex;
13+
align-items: center;
14+
}
15+
16+
.socialIcons {
17+
margin-left: 200px;
18+
display: flex;
19+
gap: 1rem;
20+
position: relative;
21+
bottom: 20px;
22+
}
23+
24+
.socialIconLink {
25+
display: inline-flex;
26+
align-items: center;
27+
justify-content: center;
28+
color: white;
29+
}
30+
1131
.content {
1232
max-width: $main-width;
1333
margin: 0 auto;
@@ -131,8 +151,17 @@
131151
}
132152
}
133153

134-
@media screen and (min-width: $breakpoint-lg) {
154+
@media screen and (max-width: $breakpoint-lg) {
135155
.content {
136156
padding-bottom: 6.75rem;
137157
}
158+
.topRow {
159+
display: flex;
160+
flex-direction: column;
161+
align-items: flex-start;
162+
}
163+
164+
.socialIcons {
165+
margin-left: 0;
166+
}
138167
}

src/components/site-footer/site-footer.spec.js

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import React from 'react';
2-
import { render, screen } from '@testing-library/react';
2+
import { getByLabelText, render, screen } from '@testing-library/react';
33
import SiteFooter, { siteFooterColumns } from './site-footer';
44
import Analytics from '../../utils/analytics/analytics';
55
import { RecoilRoot } from 'recoil';
66

7+
78
jest.mock('../download-sticky/download-sticky', () => () => <div data-testid="download-sticky" />);
89
jest.mock('../download-modal/resume-download-modal/resume-download-modal', () => () => <div data-testid="resume-download-modal" />);
910

@@ -227,4 +228,26 @@ describe('SiteFooter', () => {
227228
});
228229
spy.mockClear();
229230
});
231+
232+
it('contains social links and navigates to profile', () => {
233+
const { getByLabelText } = render(
234+
<RecoilRoot>
235+
<SiteFooter />
236+
</RecoilRoot>
237+
);
238+
const socialLinks= [
239+
{ label: 'facebook', href: 'https://www.facebook.com/fiscalservice'},
240+
{ label: 'x', href: 'https://x.com/FiscalService'},
241+
{ label: 'linkedin', href: 'https://www.linkedin.com/company/1722850/'},
242+
{ label: 'youtube', href: 'https://www.youtube.com/channel/UCrezr4h8sW9zB6IEoKwBqRQ/videos'}
243+
]
244+
socialLinks.forEach(({label, href }) => {
245+
const element = getByLabelText(label);
246+
expect(element).toBeInTheDocument();
247+
expect(element).toHaveAttribute('href', href);
248+
expect(element).toHaveAttribute('target', '_blank');
249+
});
250+
});
230251
});
252+
253+

src/components/topics-section/homepage-tile/homepage-tile-helper.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,10 @@ export const pageTileMap = {
183183
'state-and-local-government-series': {
184184
title: 'Explore How State and Local Governments invest in U.S. Treasury Securities',
185185
body:
186-
'State and Local Government Series (SLGS) are non-marketable securities that help state and local '+
186+
'State and Local Government Series (SLGS) are non-marketable securities that help state and local ' +
187187
'governments meet their financing needs. Learn more and explore monthly trends in outstanding SLGS securities. ',
188188
altText:
189-
'Illustration with images including three buildings with the text, “Why do we invest in '+
189+
'Illustration with images including three buildings with the text, “Why do we invest in ' +
190190
'State and Local Government Series Securities? Fiscal Data Explains”, and the Fiscal Data logo in the bottom right corner. ',
191191
desktopImage: 'State-and-local-government-series-1200_630',
192192
mobileImage: 'State-and-local-government-series-1200_630',
@@ -200,7 +200,7 @@ export const pageTileMap = {
200200
'In {YYYY (latest complete FY)}, U.S. citizens invested {$XXX million (total savings bonds purchased in latest ' +
201201
'complete FY)} in savings bonds. Discover how savings bonds help finance the federal government and the benefits ' +
202202
'these bonds offer to citizens who choose to invest in them.',
203-
altText: 'Images of savings bonds, including Series H and Series EE, surrounding the text “Fiscal Data Explains: Savings Bonds.”',
203+
altText: 'Savings bonds, including Series H and Series EE, surrounding the text “Fiscal Data Explains: Savings Bonds.”',
204204
desktopImage: 'Savings-Bonds-Homepage-Tile_1200x630',
205205
mobileImage: 'Savings-Bonds-Homepage-Tile_1200x630',
206206
path: '/treasury-savings-bonds/',

src/layouts/explainer/sections/national-debt/national-debt-explained/national-debt-explained-table/national-debt-explained-table.jsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,13 @@ const NationalDebtExplainedTable = () => {
2525
<div
2626
className={nationalDebtExplainedTable}
2727
role="img"
28-
aria-label="Image displays fictional data to show the connection of revenue, spending, deficit, and debt for two years."
28+
aria-label={
29+
'A financial diagram showing fictional budget information with purple icons and text. The image has three columns ' +
30+
'labeled "Revenue" (with a stacked coins icon), "Spending" (with a funnel and dollar sign icon), and "Deficit" (with a document ' +
31+
'and dollar sign icon). The data shows Year 1 with $400 revenue and $500 spending resulting in a -$100 deficit. Year 2 ' +
32+
'shows $600 revenue and $800 spending resulting in a -$200 deficit. At the bottom, these deficits sum to -$300, labeled ' +
33+
'as "Debt" with a curved arrow pointing to it.'
34+
}
2935
>
3036
<table>
3137
<thead>

0 commit comments

Comments
 (0)