Skip to content

Commit afe0392

Browse files
committed
update: update the test coverage for the footer nav
1 parent 4f6b37d commit afe0392

File tree

3 files changed

+60
-3
lines changed

3 files changed

+60
-3
lines changed

src/components/Footer.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import LanguageSelector from './LanguageSelector';
1111
ensureConfig([
1212
'LMS_BASE_URL',
1313
'LOGO_TRADEMARK_URL',
14+
'INDIGO_FOOTER_NAV_LINKS',
1415
], 'Footer component');
1516

1617
const EVENT_NAMES = {

src/components/Footer.test.jsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@ import { AppContext } from '@edx/frontend-platform/react';
77

88
import Footer from './Footer';
99

10+
jest.mock('@edx/frontend-platform', () => ({
11+
...jest.requireActual('@edx/frontend-platform'),
12+
getConfig: () => ({
13+
LMS_BASE_URL: process.env.LMS_BASE_URL,
14+
INDIGO_FOOTER_NAV_LINKS: [
15+
{ title: 'About Us', url: '/about' },
16+
{ title: 'Contact', url: '/contact' },
17+
],
18+
}),
19+
}));
20+
1021
const FooterWithContext = ({ locale = 'es' }) => {
1122
const contextValue = useMemo(() => ({
1223
authenticatedUser: null,

src/components/__snapshots__/Footer.test.jsx.snap

Lines changed: 48 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,22 @@ exports[`<Footer /> renders correctly renders with a language selector 1`] = `
5151
<nav
5252
className="nav-colophon"
5353
>
54-
<ol />
54+
<ol>
55+
<li>
56+
<a
57+
href="http://localhost:18000/about"
58+
>
59+
About Us
60+
</a>
61+
</li>
62+
<li>
63+
<a
64+
href="http://localhost:18000/contact"
65+
>
66+
Contact
67+
</a>
68+
</li>
69+
</ol>
5570
</nav>
5671
</div>
5772
<span
@@ -153,7 +168,22 @@ exports[`<Footer /> renders correctly renders without a language selector 1`] =
153168
<nav
154169
className="nav-colophon"
155170
>
156-
<ol />
171+
<ol>
172+
<li>
173+
<a
174+
href="http://localhost:18000/about"
175+
>
176+
About Us
177+
</a>
178+
</li>
179+
<li>
180+
<a
181+
href="http://localhost:18000/contact"
182+
>
183+
Contact
184+
</a>
185+
</li>
186+
</ol>
157187
</nav>
158188
</div>
159189
<span
@@ -216,7 +246,22 @@ exports[`<Footer /> renders correctly renders without a language selector in es
216246
<nav
217247
className="nav-colophon"
218248
>
219-
<ol />
249+
<ol>
250+
<li>
251+
<a
252+
href="http://localhost:18000/about"
253+
>
254+
About Us
255+
</a>
256+
</li>
257+
<li>
258+
<a
259+
href="http://localhost:18000/contact"
260+
>
261+
Contact
262+
</a>
263+
</li>
264+
</ol>
220265
</nav>
221266
</div>
222267
<span

0 commit comments

Comments
 (0)