test links on Home-Page View
This commit is contained in:
@@ -3,6 +3,8 @@
|
|||||||
import FileRect from '$lib/icons/File-rect.svelte';
|
import FileRect from '$lib/icons/File-rect.svelte';
|
||||||
import ListIcon from '$lib/icons/List-icon.svelte';
|
import ListIcon from '$lib/icons/List-icon.svelte';
|
||||||
|
|
||||||
|
import { ROUTE_NAMES } from '../index.js';
|
||||||
|
|
||||||
export let data;
|
export let data;
|
||||||
export let outline = true;
|
export let outline = true;
|
||||||
</script>
|
</script>
|
||||||
@@ -18,7 +20,7 @@
|
|||||||
>
|
>
|
||||||
<ListIcon class=" group-hover:text-indigo-600" />
|
<ListIcon class=" group-hover:text-indigo-600" />
|
||||||
</div>
|
</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
|
Vorgänge
|
||||||
<span class="absolute inset-0"></span>
|
<span class="absolute inset-0"></span>
|
||||||
</a>
|
</a>
|
||||||
@@ -34,7 +36,7 @@
|
|||||||
>
|
>
|
||||||
<AddProcess class=" group-hover:text-indigo-600" />
|
<AddProcess class=" group-hover:text-indigo-600" />
|
||||||
</div>
|
</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
|
Hinzufügen
|
||||||
<span class="absolute inset-0"></span>
|
<span class="absolute inset-0"></span>
|
||||||
</a>
|
</a>
|
||||||
@@ -47,7 +49,7 @@
|
|||||||
>
|
>
|
||||||
<FileRect class=" group-hover:text-indigo-600" {outline} />
|
<FileRect class=" group-hover:text-indigo-600" {outline} />
|
||||||
</div>
|
</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
|
Benutzerverwaltung
|
||||||
<span class="absolute inset-0"></span>
|
<span class="absolute inset-0"></span>
|
||||||
</a>
|
</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