aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/molecules/buttons/back-to-top/back-to-top.test.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/molecules/buttons/back-to-top/back-to-top.test.tsx')
-rw-r--r--src/components/molecules/buttons/back-to-top/back-to-top.test.tsx17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/components/molecules/buttons/back-to-top/back-to-top.test.tsx b/src/components/molecules/buttons/back-to-top/back-to-top.test.tsx
new file mode 100644
index 0000000..00eb020
--- /dev/null
+++ b/src/components/molecules/buttons/back-to-top/back-to-top.test.tsx
@@ -0,0 +1,17 @@
+import { describe, expect, it } from '@jest/globals';
+import { render, screen as rtlScreen } from '@testing-library/react';
+import { BackToTop } from './back-to-top';
+
+describe('BackToTop', () => {
+ it('renders a BackToTop link', () => {
+ const anchor = '#top';
+ const label = 'eveniet';
+
+ render(<BackToTop anchor={anchor} label={label} />);
+
+ const link = rtlScreen.getByRole('link');
+
+ expect(link).toHaveAccessibleName(label);
+ expect(link).toHaveAttribute('href', anchor);
+ });
+});