feat: Kategorie "Eigene Module" fuer selbst angelegte Eintraege
CUSTOM_MODULE_CATEGORIES = MODULE_CATEGORIES + custom-modules; API prueft dagegen, das Formular bietet sie an. Die Seitenleiste zeigt die Gruppe wie jede Kategorie nur mit Eintrag und stellt sie immer ans Ende. Nutzerwunsch 29.09.; ohne Migration (category ist Freitext mit IsIn-Pruefung). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -299,6 +299,32 @@ describe('Sidebar', () => {
|
||||
expect(screen.getByText('Domain-Tools')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('Kategorie „Eigene Module“ steht zuletzt und nur, wenn ein Eintrag darin liegt', async () => {
|
||||
mockCustomModules = [
|
||||
customModule({ id: 'cm-1', category: 'custom-modules', name: 'Mein Wiki' }),
|
||||
customModule({ id: 'cm-2', category: 'fleet', name: 'Tankkarte' }),
|
||||
];
|
||||
const Sidebar = await importSidebar();
|
||||
const { unmount } = render(<Sidebar />);
|
||||
|
||||
await waitFor(() => {
|
||||
expect(screen.getByText('Mein Wiki')).toBeInTheDocument();
|
||||
});
|
||||
const groups = Array.from(
|
||||
screen.getByRole('group', { name: 'Kategorien' }).querySelectorAll(':scope > ul > li > button span.truncate'),
|
||||
).map((n) => n.textContent);
|
||||
expect(groups.at(-1)).toBe('custom-modules');
|
||||
expect(groups).toContain('fleet');
|
||||
unmount();
|
||||
|
||||
mockCustomModules = [customModule({ category: 'fleet' })];
|
||||
render(<Sidebar />);
|
||||
await waitFor(() => {
|
||||
expect(screen.getByText('fleet')).toBeInTheDocument();
|
||||
});
|
||||
expect(screen.queryByText('custom-modules')).toBeNull();
|
||||
});
|
||||
|
||||
it('eingebaute Module stehen innerhalb einer Kategorie vor eigenen', async () => {
|
||||
mockCustomModules = [customModule({ category: 'Domain-Tools', name: 'Aaa Eigenes' })];
|
||||
const Sidebar = await importSidebar();
|
||||
|
||||
Reference in New Issue
Block a user