f090_magic_strings_refactoring #35

Merged
jared merged 29 commits from f090_magic_strings_refactoring into development 2025-09-30 13:33:27 +02:00
Showing only changes of commit ec537901a6 - Show all commits

View File

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