aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/molecules/buttons/back-to-top.test.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/molecules/buttons/back-to-top.test.tsx')
-rw-r--r--src/components/molecules/buttons/back-to-top.test.tsx11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/components/molecules/buttons/back-to-top.test.tsx b/src/components/molecules/buttons/back-to-top.test.tsx
index aaae3ef..a775841 100644
--- a/src/components/molecules/buttons/back-to-top.test.tsx
+++ b/src/components/molecules/buttons/back-to-top.test.tsx
@@ -1,11 +1,14 @@
import { describe, expect, it } from '@jest/globals';
-import { render, screen } from '../../../../tests/utils';
+import { render, screen as rtlScreen } from '../../../../tests/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');
+ const id = 'top';
+
+ render(<BackToTop to={id} />);
+
+ expect(rtlScreen.getByRole('link')).toHaveAccessibleName('Back to top');
+ expect(rtlScreen.getByRole('link')).toHaveAttribute('href', `#${id}`);
});
});