mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-23 07:26:30 +00:00
fix(client): block renaming a storage backend onto an existing name
This commit is contained in:
@@ -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();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user