aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/molecules/buttons/back-to-top.test.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2022-04-01 19:03:42 +0200
committerArmand Philippot <git@armandphilippot.com>2022-04-01 22:58:18 +0200
commitd177e0c7c61845b516d4a361a21739bb6486b9b5 (patch)
tree3905aab133889d5d59f8116fbcf301930b858887 /src/components/molecules/buttons/back-to-top.test.tsx
parent163f9dc0fe436b708de4e59999e87005c6685a0f (diff)
chore: add a back to top component
Diffstat (limited to 'src/components/molecules/buttons/back-to-top.test.tsx')
-rw-r--r--src/components/molecules/buttons/back-to-top.test.tsx10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/components/molecules/buttons/back-to-top.test.tsx b/src/components/molecules/buttons/back-to-top.test.tsx
new file mode 100644
index 0000000..2b3a0a9
--- /dev/null
+++ b/src/components/molecules/buttons/back-to-top.test.tsx
@@ -0,0 +1,10 @@
+import { render, screen } from '@test-utils';
+import BackToTop from './back-to-top';
+
+describe('BackToTop', () => {
+ it('renders a BackToTop link', () => {
+ render(<BackToTop target="top" />);
+ expect(screen.getByRole('link')).toHaveAccessibleName('Back to top');
+ expect(screen.getByRole('link')).toHaveAttribute('href', '/#top');
+ });
+});