aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/templates/layout/site-footer/site-footer.test.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2023-11-21 19:01:18 +0100
committerArmand Philippot <git@armandphilippot.com>2023-11-22 12:52:35 +0100
commitd4045fbcbfa8208ec31539744417f315f1f6fad8 (patch)
tree54746d3e28cc6e4a2d7d1e54a4b2e3e1e74a6896 /src/components/templates/layout/site-footer/site-footer.test.tsx
parentc6212f927daf3c928f479afa052e4772216a2d8a (diff)
refactor(components): split Layout component in smaller components
The previous component was too long and hardly readable. So I splitted it in different part and added tests.
Diffstat (limited to 'src/components/templates/layout/site-footer/site-footer.test.tsx')
-rw-r--r--src/components/templates/layout/site-footer/site-footer.test.tsx20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/components/templates/layout/site-footer/site-footer.test.tsx b/src/components/templates/layout/site-footer/site-footer.test.tsx
new file mode 100644
index 0000000..fa60b8f
--- /dev/null
+++ b/src/components/templates/layout/site-footer/site-footer.test.tsx
@@ -0,0 +1,20 @@
+import { describe, expect, it } from '@jest/globals';
+import { render, screen as rtlScreen } from '../../../../../tests/utils';
+import { CONFIG } from '../../../../utils/config';
+import { ROUTES } from '../../../../utils/constants';
+import { SiteFooter } from './site-footer';
+
+describe('SiteFooter', () => {
+ it('renders the website colophon', () => {
+ render(<SiteFooter />);
+
+ expect(rtlScreen.getByRole('contentinfo')).toBeInTheDocument();
+ expect(rtlScreen.getByText(CONFIG.copyright.startYear)).toBeInTheDocument();
+ expect(rtlScreen.getByText(CONFIG.copyright.endYear)).toBeInTheDocument();
+ expect(rtlScreen.getByText(new RegExp(CONFIG.name))).toBeInTheDocument();
+ expect(rtlScreen.getByTitle('CC BY SA')).toBeInTheDocument();
+ expect(
+ rtlScreen.getByRole('link', { name: 'Legal notice' })
+ ).toHaveAttribute('href', ROUTES.LEGAL_NOTICE);
+ });
+});