diff --git a/src/components/atoms/IconButton/IconButton.ts b/src/components/atoms/IconButton/IconButton.ts deleted file mode 100644 index 982c1c3..0000000 --- a/src/components/atoms/IconButton/IconButton.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { IconButton as MuiIconButton, styled } from '@mui/material' - -const IconButton = styled(MuiIconButton)(({ theme }) => ({ - ':hover': { - backgroundColor: 'transparent', - color: theme.palette.primary.main, - }, -})) -export default IconButton diff --git a/src/components/atoms/IconButton/index.ts b/src/components/atoms/IconButton/index.ts deleted file mode 100644 index 9de6d2c..0000000 --- a/src/components/atoms/IconButton/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { default } from './IconButton' diff --git a/src/components/atoms/IconLinks/IconLinks.test.tsx b/src/components/atoms/IconLinks/IconLinks.test.tsx index 5bfb814..efef427 100644 --- a/src/components/atoms/IconLinks/IconLinks.test.tsx +++ b/src/components/atoms/IconLinks/IconLinks.test.tsx @@ -1,9 +1,8 @@ // IconLinks.test.tsx import { render, screen } from '@testing-library/react' -import userEvent from '@testing-library/user-event' -import * as IconLinks from '.' +import * as IconLinks from './index.js' const labels: { [key: string]: string } = { DescriptionIconLink: 'Doc-button', @@ -18,8 +17,6 @@ const labels: { [key: string]: string } = { vi.stubGlobal('open', vi.fn()) describe('IconLinks', () => { - const open = vi.spyOn(window, 'open') - const defaultProps = { href: 'https://test.com', fontSize: 'large' as const, @@ -28,20 +25,10 @@ describe('IconLinks', () => { describe.each(Object.entries(IconLinks))('%s', (name, Icon) => { test('renders correctly and without crashing', async () => { render() - await userEvent.click(screen.getByLabelText(labels[name])) - expect(open).toHaveBeenCalledTimes(1) - expect(open).toHaveBeenLastCalledWith(defaultProps.href, '_blank') - }) - - test('stops propagation when the icon button is clicked', async () => { - const onClick = vi.fn() - render( -
- -
- ) - await userEvent.click(screen.getByLabelText(labels[name])) - expect(onClick).not.toHaveBeenCalled() + const link = screen.getByLabelText(labels[name]) + expect(link).toHaveAttribute('href', defaultProps.href) + expect(link).toHaveAttribute('target', '_blank') + expect(link).toHaveAttribute('rel', 'noopener noreferrer') }) test("renders the badge when 'index' is provided", () => { diff --git a/src/components/atoms/IconLinks/index.ts b/src/components/atoms/IconLinks/index.ts deleted file mode 100644 index 5e3a24e..0000000 --- a/src/components/atoms/IconLinks/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './IconLinks' diff --git a/src/components/atoms/IconLinks/IconLinks.tsx b/src/components/atoms/IconLinks/index.tsx similarity index 100% rename from src/components/atoms/IconLinks/IconLinks.tsx rename to src/components/atoms/IconLinks/index.tsx diff --git a/src/components/atoms/index.ts b/src/components/atoms/index.ts index b984195..39badb5 100644 --- a/src/components/atoms/index.ts +++ b/src/components/atoms/index.ts @@ -2,5 +2,4 @@ export { default as Award } from './Award' export { default as Extracurricular } from './Extracurricular' export { default as Publication } from './Publication' -export { default as IconLinks } from './IconButton' export * from './IconLinks'