CreateImageWizard: Implement user-friendly error messages

Puts the error messages in one place - LabelInput.tsx
This commit is contained in:
Florian Schüller 2025-05-12 12:48:24 +02:00 committed by Klara Simickova
parent 3f35101f68
commit ccfdb49db2
11 changed files with 156 additions and 97 deletions

View file

@ -120,17 +120,27 @@ describe('Step Firewall', () => {
test('port in an invalid format cannot be added', async () => {
await renderCreateMode();
await goToFirewallStep();
expect(screen.queryByText('Invalid format.')).not.toBeInTheDocument();
expect(
screen.queryByText(
'Expected format: <port/port-name>:<protocol>. Example: 8080:tcp, ssh:tcp'
)
).not.toBeInTheDocument();
await addPort('00:wrongFormat');
await screen.findByText('Invalid format.');
await screen.findByText(
'Expected format: <port/port-name>:<protocol>. Example: 8080:tcp, ssh:tcp'
);
});
test('service in an invalid format cannot be added', async () => {
await renderCreateMode();
await goToFirewallStep();
expect(screen.queryByText('Invalid format.')).not.toBeInTheDocument();
expect(
screen.queryByText('Expected format: <service-name>. Example: sshd')
).not.toBeInTheDocument();
await addPort('wrong--service');
await screen.findByText('Invalid format.');
await screen.findByText(
'Expected format: <port/port-name>:<protocol>. Example: 8080:tcp, ssh:tcp'
);
});
test('revisit step button on Review works', async () => {