Skip to content

Commit

Permalink
🧪 [open-formulieren/open-forms#3536] Add regression test for appointm…
Browse files Browse the repository at this point in the history
…ent form crash
  • Loading branch information
sergei-maertens committed Nov 1, 2023
1 parent 51734da commit e4b95ae
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -233,3 +233,25 @@ describe('Preselecting a product via querystring', () => {
expect(await screen.findByText('Paspoort aanvraag')).toBeVisible();
});
});

describe('Changing the product amounts', () => {
// regression test for https://github.com/open-formulieren/open-forms/issues/3536
it('does not crash when clearing the amount field to enter a value', async () => {
mswServer.use(mockSubmissionPost(buildSubmission({steps: []})), mockAppointmentProductsGet);
const user = userEvent.setup({delay: null});

renderApp();

const productDropdown = await screen.findByRole('combobox');
expect(productDropdown).toBeVisible();

const amountInput = screen.getByLabelText('Amount');
expect(amountInput).toBeVisible();
expect(amountInput).toHaveDisplayValue('1');

// clear the field value to enter a different value
await user.clear(amountInput);
await user.type(amountInput, '3');
expect(amountInput).toHaveDisplayValue('3');
});
});

0 comments on commit e4b95ae

Please sign in to comment.