22 lines
849 B
TypeScript
22 lines
849 B
TypeScript
import { render } from '@testing-library/svelte';
|
|
import { describe, expect, it } from "vitest";
|
|
import VorgangListPage from '../src/routes/(angemeldet)/list/+page.svelte';
|
|
import { baseData } from './fixtures';
|
|
|
|
describe('Vorgänge Liste Page EmptyList-Komponente View', ()=>{
|
|
it('zeigt EmptyList-Komponente an, wenn Liste leer ist', () => {
|
|
const testData = { ...baseData, vorgangList: [] };
|
|
const { getByTestId } = render(VorgangListPage, {props:{data: testData}});
|
|
|
|
expect(getByTestId('empty-list')).toBeInTheDocument();
|
|
});
|
|
|
|
it('zeigt Liste(mockData 2 Elemente) an, wenn Liste vorhanden ist', () => {
|
|
const testData = { ...baseData };
|
|
const { getAllByTestId } = render(VorgangListPage, {props:{data: testData}});
|
|
const items = getAllByTestId('test-list-item');
|
|
|
|
expect(items.length).toBeGreaterThan(0);
|
|
});
|
|
})
|