Skip to content

Commit

Permalink
test: update snapshot with context
Browse files Browse the repository at this point in the history
  • Loading branch information
navinkarkera committed Jul 5, 2023
1 parent 5344e7a commit 43efd5a
Show file tree
Hide file tree
Showing 3 changed files with 152 additions and 89 deletions.
2 changes: 1 addition & 1 deletion src/components/Footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class SiteFooter extends React.Component {
return (
<footer
role="contentinfo"
className={`footer d-flex border-top py-3 px-4 ${config.FOOTER_CUSTOM_CLASSNAMES}`}
className={`footer d-flex border-top py-3 px-4 ${config.FOOTER_CUSTOM_CLASSNAMES || ''}`}
style={config.FOOTER_CUSTOM_STYLE}
>
<a
Expand Down
9 changes: 9 additions & 0 deletions src/components/Footer.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ const FooterWithContext = ({ locale = 'es' }) => {
config: {
LOGO_TRADEMARK_URL: process.env.LOGO_TRADEMARK_URL,
LMS_BASE_URL: process.env.LMS_BASE_URL,
FOOTER_CUSTOM_STYLE: { color: 'black' },
FOOTER_CUSTOM_CLASSNAMES: 'text-center',
FOOTER_LOGO_STYLE: { color: 'white' },
FOOTER_LINKS: [
{ url: 'https://openedx.org/terms-of-use/', text: 'Terms of service' },
{ url: 'https://openedx.org/code-of-conduct/', text: 'Code of conduct' },
{ url: 'https://openedx.org/privacy-policy/', text: 'Privacy Policy' },
],
FOOTER_LINKS_CLASSNAMES: 'text-dark font-weight-bold',
},
}), []);

Expand Down
230 changes: 142 additions & 88 deletions src/components/__snapshots__/Footer.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,128 +2,182 @@

exports[`<Footer /> renders correctly renders with a language selector 1`] = `
<footer
className="footer d-flex border-top py-3 px-4"
className="footer d-flex border-top py-3 px-4 "
role="contentinfo"
>
<div
className="container-fluid d-flex"
<a
aria-label="edX Home"
className="d-block"
href="http://localhost:18000"
>
<a
aria-label="edX Home"
className="d-block"
href="http://localhost:18000"
>
<img
alt="Powered by Open edX"
src="https://edx-cdn.org/v3/default/logo-trademark.svg"
style={
Object {
"maxHeight": 45,
}
<img
alt="Powered by Open edX"
src="https://edx-cdn.org/v3/default/logo-trademark.svg"
style={
Object {
"maxHeight": 45,
}
/>
</a>
<div
className="flex-grow-1"
}
/>
<form
className="form-inline"
onSubmit={[Function]}
</a>
<div
className="flex-grow-1"
/>
<form
className="form-inline justify-content-center"
onSubmit={[Function]}
>
<div
className="form-group"
>
<div
className="form-group"
<label
className="d-inline-block m-0"
htmlFor="site-footer-language-select"
>
<label
className="d-inline-block m-0"
htmlFor="site-footer-language-select"
>
Choose Language
</label>
<select
className="form-control-sm mx-2"
defaultValue="en"
id="site-footer-language-select"
name="site-footer-language-select"
Choose Language
</label>
<select
className="form-control-sm mx-2"
defaultValue="en"
id="site-footer-language-select"
name="site-footer-language-select"
>
<option
value="en"
>
<option
value="en"
>
English
</option>
<option
value="es"
>
Español
</option>
</select>
<button
className="btn btn-outline-primary btn-sm"
type="submit"
English
</option>
<option
value="es"
>
Apply
</button>
</div>
</form>
</div>
Español
</option>
</select>
<button
className="btn btn-outline-primary btn-sm"
type="submit"
>
Apply
</button>
</div>
</form>
</footer>
`;

exports[`<Footer /> renders correctly renders without a language selector 1`] = `
<footer
className="footer d-flex border-top py-3 px-4"
className="footer d-flex border-top py-3 px-4 text-center"
role="contentinfo"
style={
Object {
"color": "black",
}
}
>
<a
aria-label="edX Home"
className="d-block"
href="http://localhost:18000"
>
<img
alt="Powered by Open edX"
src="https://edx-cdn.org/v3/default/logo-trademark.svg"
style={
Object {
"color": "white",
"maxHeight": 45,
}
}
/>
</a>
<div
className="container-fluid d-flex"
className="flex-grow-1"
/>
<div
className="d-flex align-items-center justify-content-center"
>
<a
aria-label="edX Home"
className="d-block"
href="http://localhost:18000"
className="px-3 text-dark font-weight-bold"
href="https://openedx.org/terms-of-use/"
target="blank"
>
<img
alt="Powered by Open edX"
src="https://edx-cdn.org/v3/default/logo-trademark.svg"
style={
Object {
"maxHeight": 45,
}
}
/>
Terms of service
</a>
|
<a
className="px-3 text-dark font-weight-bold"
href="https://openedx.org/code-of-conduct/"
target="blank"
>
Code of conduct
</a>
|
<a
className="px-3 text-dark font-weight-bold"
href="https://openedx.org/privacy-policy/"
target="blank"
>
Privacy Policy
</a>
<div
className="flex-grow-1"
/>
</div>
</footer>
`;

exports[`<Footer /> renders correctly renders without a language selector in es 1`] = `
<footer
className="footer d-flex border-top py-3 px-4"
className="footer d-flex border-top py-3 px-4 text-center"
role="contentinfo"
style={
Object {
"color": "black",
}
}
>
<a
aria-label="edX Home"
className="d-block"
href="http://localhost:18000"
>
<img
alt="Powered by Open edX"
src="https://edx-cdn.org/v3/default/logo-trademark.svg"
style={
Object {
"color": "white",
"maxHeight": 45,
}
}
/>
</a>
<div
className="flex-grow-1"
/>
<div
className="container-fluid d-flex"
className="d-flex align-items-center justify-content-center"
>
<a
aria-label="edX Home"
className="d-block"
href="http://localhost:18000"
className="px-3 text-dark font-weight-bold"
href="https://openedx.org/terms-of-use/"
target="blank"
>
<img
alt="Powered by Open edX"
src="https://edx-cdn.org/v3/default/logo-trademark.svg"
style={
Object {
"maxHeight": 45,
}
}
/>
Terms of service
</a>
|
<a
className="px-3 text-dark font-weight-bold"
href="https://openedx.org/code-of-conduct/"
target="blank"
>
Code of conduct
</a>
|
<a
className="px-3 text-dark font-weight-bold"
href="https://openedx.org/privacy-policy/"
target="blank"
>
Privacy Policy
</a>
<div
className="flex-grow-1"
/>
</div>
</footer>
`;

0 comments on commit 43efd5a

Please sign in to comment.