From a36e49bce7b548dacb4dc55c28338e67c8b52893 Mon Sep 17 00:00:00 2001 From: luke-h1 Date: Tue, 17 Dec 2024 22:22:07 +0000 Subject: [PATCH] test(frontend): fix skills test --- src/components/Skills/Skills.test.tsx | 5 +- .../Skills/__snapshots__/Skills.test.tsx.snap | 352 +++++++++--------- 2 files changed, 180 insertions(+), 177 deletions(-) diff --git a/src/components/Skills/Skills.test.tsx b/src/components/Skills/Skills.test.tsx index ce8a1de50..961fa35da 100644 --- a/src/components/Skills/Skills.test.tsx +++ b/src/components/Skills/Skills.test.tsx @@ -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 '.'; @@ -7,7 +8,9 @@ describe('Skills', () => { const { container } = render(); 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(); }); }); diff --git a/src/components/Skills/__snapshots__/Skills.test.tsx.snap b/src/components/Skills/__snapshots__/Skills.test.tsx.snap index 32dc45bf1..c5c04b9a6 100644 --- a/src/components/Skills/__snapshots__/Skills.test.tsx.snap +++ b/src/components/Skills/__snapshots__/Skills.test.tsx.snap @@ -107,7 +107,7 @@ exports[`Skills renders correctly 1`] = `
  • - Styled component + CSS in JS
  • - Styled component + CSS in JS
  • - Styled component + CSS in JS
  • - Styled component + CSS in JS
  • - Styled component + CSS in JS
  • - Styled component + CSS in JS
  • - Styled component + CSS in JS
  • - Styled component + CSS in JS
  • - Styled component + CSS in JS
  • - Styled component + CSS in JS
  • - Styled component + CSS in JS
  • - Styled component + CSS in JS
  • - Styled component + CSS in JS
  • - Styled component + CSS in JS
  • - Styled component + CSS in JS
  • - Styled component + CSS in JS
  • - Styled component + CSS in JS
  • - Styled component + CSS in JS
  • - Styled component + CSS in JS
  • - Styled component + CSS in JS
  • - Styled component + CSS in JS
  • - Styled component + CSS in JS