mirror of
https://github.com/apache/superset.git
synced 2026-07-11 17:25:31 +00:00
fix(explore): dispatch onChange immediately on NumberControl stepper arrow clicks (#39220)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -82,6 +82,21 @@ test('can clear field completely', async () => {
|
||||
expect(props.onChange).toHaveBeenLastCalledWith(undefined);
|
||||
});
|
||||
|
||||
test('stepper arrows trigger onChange immediately', async () => {
|
||||
const props = {
|
||||
...mockedProps,
|
||||
value: 5,
|
||||
onChange: jest.fn(),
|
||||
};
|
||||
render(<NumberControl {...props} />);
|
||||
const upButton = document.querySelector(
|
||||
'.ant-input-number-handler-up',
|
||||
) as HTMLElement;
|
||||
expect(upButton).toBeInTheDocument();
|
||||
await userEvent.click(upButton);
|
||||
expect(props.onChange).toHaveBeenCalledWith(6);
|
||||
});
|
||||
|
||||
test('updates local value when prop changes', () => {
|
||||
const props = {
|
||||
...mockedProps,
|
||||
|
||||
Reference in New Issue
Block a user