add UI test

This commit is contained in:
2025-09-25 08:11:18 +02:00
parent bd0c324705
commit ec537901a6

View File

@@ -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 <svg> 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 <svg> 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();
});
});