Skip to content

Commit

Permalink
Merge pull request #4617 from luke-h1/dev
Browse files Browse the repository at this point in the history
merge dev into main
  • Loading branch information
luke-h1 authored Dec 18, 2024
2 parents 9e5036f + a36e49b commit d8720e8
Show file tree
Hide file tree
Showing 7 changed files with 231 additions and 190 deletions.
2 changes: 2 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ const nextConfig = {
// Force SWC transform on build to stop Next.js trying to use babel
// since babel is only needed to support vanilla-extract in unit tests
forceSwcTransforms: true,

serverComponentsHmrCache: true,
},
images: {
minimumCacheTTL: 120,
Expand Down
3 changes: 2 additions & 1 deletion src/components/SkillItem/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use client';

import toCamelCase from '@frontend/utils/toCamelCase';
import { useTheme } from 'next-themes';
import { useEffect } from 'react';
import type { IconType } from 'react-icons';
Expand All @@ -24,7 +25,7 @@ const SkillItem = ({ icon, text }: SkillItemProps) => {

return (
<li>
<span className={styles.bg} data-testid={`${text}-icon`}>
<span className={styles.bg} data-testid={`${toCamelCase(text)}-icon`}>
{icon({
size: 30,
className: styles.skillIcon,
Expand Down
5 changes: 4 additions & 1 deletion src/components/Skills/Skills.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import render from '@frontend/test/render';
import toCamelCase from '@frontend/utils/toCamelCase';
import { screen } from '@testing-library/react';
import Skills, { skills } from '.';

Expand All @@ -7,7 +8,9 @@ describe('Skills', () => {
const { container } = render(<Skills />);
skills.forEach(skill => {
expect(screen.getByText(skill.text)).toBeInTheDocument();
expect(screen.getByTestId(`${skill.text}-icon`)).toBeInTheDocument();
expect(
screen.getByTestId(`${toCamelCase(skill.text)}-icon`),
).toBeInTheDocument();
expect(container).toMatchSnapshot();
});
});
Expand Down
Loading

0 comments on commit d8720e8

Please sign in to comment.