diff --git a/frontend/src/components/LevelMissionInfoBanner/LevelMissionInfoBanner.test.tsx b/frontend/src/components/LevelMissionInfoBanner/LevelMissionInfoBanner.test.tsx index a7ac8fb1a..1d5b78ff7 100644 --- a/frontend/src/components/LevelMissionInfoBanner/LevelMissionInfoBanner.test.tsx +++ b/frontend/src/components/LevelMissionInfoBanner/LevelMissionInfoBanner.test.tsx @@ -1,4 +1,9 @@ -import { render, screen, fireEvent } from '@testing-library/react'; +import { + render, + screen, + fireEvent, + getDefaultNormalizer, +} from '@testing-library/react'; import { describe, expect, test, vi } from 'vitest'; import { LEVELS } from '@src/Levels'; @@ -21,10 +26,10 @@ describe('LevelMissionInfoBanner component tests', () => { if (!expectedContent) throw new Error(`No missionInfoShort found for level ${currentLevel}`); - const expectedText = expectedContent - .slice(0, expectedContent.indexOf(' ')) - .replace(/\s+/g, ' '); //normalising whitespace - + const expectedText = getDefaultNormalizer()( + expectedContent.slice(0, expectedContent.indexOf(' ')) + ); + console.log(expectedText); const banner = screen.getByText(expectedText); expect(banner).toContainHTML(expectedContent); });