Skip to content

Commit 3c5ae7e

Browse files
committed
fix(test): use Vite SVG imports in PlatformAbout brand logo assertions
The test was asserting hardcoded path strings but PlatformAbout.tsx now uses Vite ?url imports which resolve to data URIs in the test env. Made-with: Cursor
1 parent 0d6e69e commit 3c5ae7e

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

platform/main/PlatformAbout.test.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ import type { ComponentProps } from 'react';
1515
import { useEffect } from 'react';
1616
import { SWRConfig } from 'swr';
1717
import { afterAll, afterEach, beforeAll, describe, expect, it, vi } from 'vitest';
18+
import platformLogo from '../assets/platform-logo.svg?url';
19+
import platformLogoWhite from '../assets/platform-logo-white.svg?url';
1820
import { PlatformAbout } from './PlatformAbout';
1921

2022
vi.mock('@patternfly/react-core', async (importOriginal) => {
@@ -74,12 +76,12 @@ describe('PlatformAbout', () => {
7476
{
7577
label: 'light',
7678
activeTheme: 'light' as const,
77-
expectedSrc: '/assets/platform-logo.svg',
79+
expectedSrc: platformLogo,
7880
},
7981
{
8082
label: 'dark',
8183
activeTheme: 'dark' as const,
82-
expectedSrc: '/assets/platform-logo-white.svg',
84+
expectedSrc: platformLogoWhite,
8385
},
8486
])('should set brand image src for %# $label theme', async ({ activeTheme, expectedSrc }) => {
8587
mountAbout({ activeTheme });

0 commit comments

Comments
 (0)