formatting
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import { render } from '@testing-library/svelte';
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import VorgangListPage from '../src/routes/(angemeldet)/list/+page.svelte';
|
||||
const testUser = {
|
||||
admin: true,
|
||||
exp: 1757067123,
|
||||
iat: 1757063523,
|
||||
id: "admin",
|
||||
}
|
||||
exp: 1757067123,
|
||||
iat: 1757063523,
|
||||
id: 'admin'
|
||||
};
|
||||
const testCrimesList = [
|
||||
{
|
||||
name: 'model-A',
|
||||
@@ -24,21 +24,20 @@ const testCrimesList = [
|
||||
prefix: '7596e4d5-c51f-482d-a4aa-ff76434305fc',
|
||||
show_button: true
|
||||
}
|
||||
];
|
||||
];
|
||||
|
||||
const testVorgangsList = [
|
||||
{
|
||||
vorgangName: "vorgang-1",
|
||||
vorgangPIN: "pin-123",
|
||||
vorgangToken: "c322f26f-8c5e-4cb9-94b3-b5433bf5109e"
|
||||
vorgangName: 'vorgang-1',
|
||||
vorgangPIN: 'pin-123',
|
||||
vorgangToken: 'c322f26f-8c5e-4cb9-94b3-b5433bf5109e'
|
||||
},
|
||||
{
|
||||
vorgangName: "vorgang-2",
|
||||
vorgangPIN: "pin-2",
|
||||
vorgangToken: "cb0051bc-5f38-47b8-943c-9352d4d9c984"
|
||||
vorgangName: 'vorgang-2',
|
||||
vorgangPIN: 'pin-2',
|
||||
vorgangToken: 'cb0051bc-5f38-47b8-943c-9352d4d9c984'
|
||||
}
|
||||
|
||||
]
|
||||
];
|
||||
|
||||
const baseData = {
|
||||
user: testUser,
|
||||
@@ -46,23 +45,22 @@ const baseData = {
|
||||
vorgangList: testVorgangsList,
|
||||
crimesList: testCrimesList,
|
||||
url: URL,
|
||||
crimeNames: [ "modell-A" ],
|
||||
crimeNames: ['modell-A']
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
describe('Vorgänge Liste Page EmptyList-Komponente View', ()=>{
|
||||
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}});
|
||||
const { getByTestId } = render(VorgangListPage, { props: { data: testData } });
|
||||
|
||||
expect(getByTestId('empty-list')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('zeigt Liste(min. 1 li-Element) an, wenn Liste vorhanden ist', () => {
|
||||
const testData = { ...baseData };
|
||||
const { getAllByTestId } = render(VorgangListPage, {props:{data: testData}});
|
||||
const items = getAllByTestId('test-list-item');
|
||||
const { getAllByTestId } = render(VorgangListPage, { props: { data: testData } });
|
||||
const items = getAllByTestId('test-list-item');
|
||||
|
||||
expect(items).toHaveLength(2);
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user