organize tests into units
This commit is contained in:
24
tests/views/Home.view.test.ts
Normal file
24
tests/views/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 '$root/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