f090_magic_strings_refactoring #35
@@ -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
24
tests/Home.view.test.ts
Normal 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);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user