fix(client): block renaming a storage backend onto an existing name

This commit is contained in:
jubnl
2026-08-20 14:45:20 +02:00
parent e22a836dd8
commit c4b1e18eaf
4 changed files with 22 additions and 2 deletions
@@ -90,4 +90,13 @@ describe('MAdminStoragePanel', () => {
fireEvent.click(screen.getByRole('button', { name: 'Save changes' }));
expect(await screen.findByText('registry says no')).toBeInTheDocument();
});
it('FE-MOB-MSTOR-005: renaming onto another existing backend warns and blocks Apply', async () => {
await renderPanel();
fireEvent.click(within(screen.getByTestId('m-storage-backend-off-box')).getByRole('button', { name: 'Edit' }));
const nameInput = screen.getByDisplayValue('off-box');
fireEvent.change(nameInput, { target: { value: 'uploads-local' } });
expect(screen.getByText(/A backend named uploads-local already exists/)).toBeInTheDocument();
expect(screen.getByRole('button', { name: 'Apply' })).toBeDisabled();
});
});