diff --git a/tests/components/Footer.test.ts b/tests/components/Footer.test.ts index ff59135..041c8e5 100644 --- a/tests/components/Footer.test.ts +++ b/tests/components/Footer.test.ts @@ -24,14 +24,13 @@ describe('Footer component', () => { id: 'admin' } }; - const { container } = render(Footer, { props: { data: mockData } }); + render(Footer, { props: { data: mockData } }); const linkElement = screen.getByText('admin', { exact: false }); expect(linkElement).toBeInTheDocument(); expect(linkElement).toHaveAttribute('href', ROUTE_NAMES.ROOT); // Check for presence of `Profile` component - // Look for the element with class="w-6 h-6" - const svg = container.querySelector('svg.w-6.h-6'); + const svg = screen.getByTestId('profile-component'); expect(svg).toBeTruthy(); }); test('Enthält Profil-Icon und entsprechenden Link: nicht angemeldet', () => { @@ -46,8 +45,7 @@ describe('Footer component', () => { expect(ID_displayElement).not.toBeInTheDocument(); // Check for presence of `Profile` component - // Look for the element with class="w-6 h-6" - const svg = container.querySelector('svg.w-6.h-6'); + const svg = screen.getByTestId('profile-component'); expect(svg).toBeTruthy(); }); });