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
2 changed files with 29 additions and 3 deletions
Showing only changes of commit 67a24f3650 - Show all commits

View File

@@ -3,6 +3,8 @@
import FileRect from '$lib/icons/File-rect.svelte';
import ListIcon from '$lib/icons/List-icon.svelte';
import { ROUTE_NAMES } from '../index.js';
export let data;
export let outline = true;
</script>
@@ -18,7 +20,7 @@
>
<ListIcon class=" group-hover:text-indigo-600" />
</div>
<a href="/list" class="mt-6 block font-semibold text-gray-900">
<a href="{ROUTE_NAMES.LIST}" class="mt-6 block font-semibold text-gray-900">
Vorgänge
<span class="absolute inset-0"></span>
</a>
@@ -34,7 +36,7 @@
>
<AddProcess class=" group-hover:text-indigo-600" />
</div>
<a href="/upload" class="mt-6 block font-semibold text-gray-900">
<a href="{ROUTE_NAMES.UPLOAD}" class="mt-6 block font-semibold text-gray-900">
Hinzufügen
<span class="absolute inset-0"></span>
</a>
@@ -47,7 +49,7 @@
>
<FileRect class=" group-hover:text-indigo-600" {outline} />
</div>
<a href="/user-management" class="mt-6 block font-semibold text-gray-900">
<a href="{ROUTE_NAMES.USERMGMT}" class="mt-6 block font-semibold text-gray-900">
Benutzerverwaltung
<span class="absolute inset-0"></span>
</a>

24
tests/Home.view.test.ts Normal file
View File

@@ -0,0 +1,24 @@
import { render, screen } from '@testing-library/svelte';
import { describe, expect, it } from 'vitest';
import HomePage from '../src/routes/(angemeldet)/+page.svelte';
import { ROUTE_NAMES } from '../src/routes';
import { baseData } from './fixtures';
describe('Home-Page View', () => {
it('Überprüfe Links', () => {
render(HomePage, { props: { data: baseData } });
let linkElement = screen.getByText('Vorgänge');
expect(linkElement).toBeInTheDocument();
expect(linkElement).toHaveAttribute('href', ROUTE_NAMES.LIST);
linkElement = screen.getByText('Hinzufügen');
expect(linkElement).toBeInTheDocument();
expect(linkElement).toHaveAttribute('href', ROUTE_NAMES.UPLOAD);
linkElement = screen.getByText('Benutzerverwaltung');
expect(linkElement).toBeInTheDocument();
expect(linkElement).toHaveAttribute('href', ROUTE_NAMES.USERMGMT);
});
});