Skip to content

Commit

Permalink
fix(frontend): update skills section
Browse files Browse the repository at this point in the history
  • Loading branch information
luke-h1 committed Dec 17, 2024
1 parent bf6adde commit e89dfb0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
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
2 changes: 1 addition & 1 deletion src/components/Skills/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const skills: SkillItemProps[] = [
},
{
icon: SiStyledComponents,
text: 'Styled component',
text: 'CSS in JS',
},
{
icon: BiTestTube,
Expand Down
16 changes: 5 additions & 11 deletions src/utils/__tests__/toCamelCase.test.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
import toCamelCase from '../toCamelCase';

describe('toCamelCase', () => {
test('should convert a string to camel case', () => {
test('converts string to camel-case', () => {
const str = 'Hello World';
const result = toCamelCase(str);
expect(result).toBe('HelloWorld');
expect(result).toEqual('HelloWorld');
});

test('should convert a string to camel case', () => {
const str = 'Hello World';
const result = toCamelCase(str);
expect(result).toBe('HelloWorld');
});

test('should convert a string to camel case', () => {
const str = 'Hello World';
test('multiple gaps get converted to camel-case', () => {
const str = 'AWS Azure Vercel';
const result = toCamelCase(str);
expect(result).toBe('HelloWorld');
expect(result).toEqual('AWSAzureVercel');
});
});

0 comments on commit e89dfb0

Please sign in to comment.