mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 01:57:35 -03:30
Merge pull request #10342 from mabashian/10338-checkbox-double-select
Fixes bug where checkbox list item was selecting things twice SUMMARY Resolves #10338 There was a click event on the row and the underlying checkbox. I got rid of the underlying click event so now its only handled at the row level. ISSUE TYPE Bugfix Pull Request COMPONENT NAME UI Reviewed-by: Alex Corey <Alex.swansboro@gmail.com> Reviewed-by: Tiago Góes <tiago.goes2009@gmail.com>
This commit is contained in:
commit
c34fa30ea7
@ -208,7 +208,7 @@ describe('<AdHocCommands />', () => {
|
||||
wrapper
|
||||
.find('td#check-action-item-2')
|
||||
.find('input')
|
||||
.simulate('change', { target: { checked: true } });
|
||||
.simulate('click');
|
||||
});
|
||||
|
||||
wrapper.update();
|
||||
@ -227,7 +227,7 @@ describe('<AdHocCommands />', () => {
|
||||
wrapper
|
||||
.find('td#check-action-item-4')
|
||||
.find('input')
|
||||
.simulate('change', { target: { checked: true } });
|
||||
.simulate('click');
|
||||
});
|
||||
|
||||
wrapper.update();
|
||||
@ -377,11 +377,7 @@ describe('<AdHocCommands />', () => {
|
||||
wrapper
|
||||
.find('td#check-action-item-2')
|
||||
.find('input')
|
||||
.simulate('change', {
|
||||
target: {
|
||||
checked: true,
|
||||
},
|
||||
});
|
||||
.simulate('click');
|
||||
});
|
||||
|
||||
wrapper.update();
|
||||
@ -400,11 +396,7 @@ describe('<AdHocCommands />', () => {
|
||||
wrapper
|
||||
.find('td#check-action-item-4')
|
||||
.find('input')
|
||||
.simulate('change', {
|
||||
target: {
|
||||
checked: true,
|
||||
},
|
||||
});
|
||||
.simulate('click');
|
||||
});
|
||||
|
||||
wrapper.update();
|
||||
|
||||
@ -155,7 +155,7 @@ describe('<AdHocCommandsWizard/>', () => {
|
||||
wrapper
|
||||
.find('td#check-action-item-1')
|
||||
.find('input')
|
||||
.simulate('change', { target: { checked: true } });
|
||||
.simulate('click');
|
||||
});
|
||||
|
||||
wrapper.update();
|
||||
@ -181,7 +181,7 @@ describe('<AdHocCommandsWizard/>', () => {
|
||||
wrapper
|
||||
.find('td#check-action-item-1')
|
||||
.find('input')
|
||||
.simulate('change', { target: { checked: true } });
|
||||
.simulate('click');
|
||||
});
|
||||
|
||||
wrapper.update();
|
||||
|
||||
@ -95,6 +95,7 @@ describe('<_AddResourceRole />', () => {
|
||||
|
||||
// Step 2
|
||||
await waitForElement(wrapper, 'EmptyStateBody', el => el.length === 0);
|
||||
expect(wrapper.find('Chip').length).toBe(0);
|
||||
act(() =>
|
||||
wrapper.find('CheckboxListItem[name="foo"]').invoke('onSelect')(true)
|
||||
);
|
||||
@ -102,6 +103,7 @@ describe('<_AddResourceRole />', () => {
|
||||
expect(
|
||||
wrapper.find('CheckboxListItem[name="foo"]').prop('isSelected')
|
||||
).toBe(true);
|
||||
expect(wrapper.find('Chip').length).toBe(1);
|
||||
act(() => wrapper.find('Button[type="submit"]').prop('onClick')());
|
||||
wrapper.update();
|
||||
|
||||
|
||||
@ -122,7 +122,7 @@ describe('<SelectResourceStep />', () => {
|
||||
checkboxListItemWrapper
|
||||
.first()
|
||||
.find('input[type="checkbox"]')
|
||||
.simulate('change', { target: { checked: true } });
|
||||
.simulate('click');
|
||||
expect(handleRowClick).toHaveBeenCalledWith(data.results[0]);
|
||||
});
|
||||
});
|
||||
|
||||
@ -34,7 +34,6 @@ const CheckboxListItem = ({
|
||||
select={{
|
||||
rowIndex,
|
||||
isSelected,
|
||||
onSelect: isSelected ? onDeselect : onSelect,
|
||||
variant: isRadio ? 'radio' : 'checkbox',
|
||||
}}
|
||||
name={name}
|
||||
|
||||
@ -183,7 +183,7 @@ describe('CredentialsStep', () => {
|
||||
wrapper
|
||||
.find('td#check-action-item-2')
|
||||
.find('input')
|
||||
.simulate('change', { target: { checked: true } });
|
||||
.simulate('click');
|
||||
});
|
||||
wrapper.update();
|
||||
expect(wrapper.find('Alert').length).toBe(1);
|
||||
@ -244,7 +244,7 @@ describe('CredentialsStep', () => {
|
||||
wrapper
|
||||
.find('td#check-action-item-5')
|
||||
.find('input')
|
||||
.simulate('change', { target: { checked: true } });
|
||||
.simulate('click');
|
||||
});
|
||||
wrapper.update();
|
||||
expect(wrapper.find('Alert').length).toBe(0);
|
||||
@ -321,7 +321,7 @@ describe('CredentialsStep', () => {
|
||||
wrapper
|
||||
.find('td#check-action-item-33')
|
||||
.find('input')
|
||||
.simulate('change', { target: { checked: true } });
|
||||
.simulate('click');
|
||||
});
|
||||
wrapper.update();
|
||||
expect(wrapper.find('Alert').length).toBe(0);
|
||||
|
||||
@ -343,11 +343,7 @@ describe('<ScheduleAdd />', () => {
|
||||
wrapper
|
||||
.find('td#check-action-item-1')
|
||||
.find('input')
|
||||
.simulate('change', {
|
||||
target: {
|
||||
checked: true,
|
||||
},
|
||||
});
|
||||
.simulate('click');
|
||||
});
|
||||
wrapper.update();
|
||||
expect(
|
||||
|
||||
@ -475,11 +475,7 @@ describe('<ScheduleEdit />', () => {
|
||||
wrapper
|
||||
.find('td#check-action-item-1')
|
||||
.find('input')
|
||||
.simulate('change', {
|
||||
target: {
|
||||
checked: true,
|
||||
},
|
||||
});
|
||||
.simulate('click');
|
||||
});
|
||||
wrapper.update();
|
||||
|
||||
@ -607,11 +603,7 @@ describe('<ScheduleEdit />', () => {
|
||||
wrapper
|
||||
.find('td#check-action-item-2')
|
||||
.find('input')
|
||||
.simulate('change', {
|
||||
target: {
|
||||
checked: true,
|
||||
},
|
||||
});
|
||||
.simulate('click');
|
||||
});
|
||||
wrapper.update();
|
||||
|
||||
|
||||
@ -345,11 +345,7 @@ describe('<ScheduleForm />', () => {
|
||||
promptWrapper
|
||||
.find('td#check-action-item-1')
|
||||
.find('input')
|
||||
.simulate('change', {
|
||||
target: {
|
||||
checked: true,
|
||||
},
|
||||
});
|
||||
.simulate('click');
|
||||
});
|
||||
promptWrapper.update();
|
||||
expect(
|
||||
|
||||
@ -150,7 +150,7 @@ describe('<UserAndTeamAccessAdd/>', () => {
|
||||
.find('CheckboxListItem')
|
||||
.first()
|
||||
.find('input[type="checkbox"]')
|
||||
.simulate('change', { target: { checked: true } })
|
||||
.simulate('click')
|
||||
);
|
||||
|
||||
wrapper.update();
|
||||
@ -231,7 +231,7 @@ describe('<UserAndTeamAccessAdd/>', () => {
|
||||
.find('CheckboxListItem')
|
||||
.first()
|
||||
.find('input[type="checkbox"]')
|
||||
.simulate('change', { target: { checked: true } })
|
||||
.simulate('click')
|
||||
);
|
||||
|
||||
wrapper.update();
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import React, { useCallback } from 'react';
|
||||
import { func, shape } from 'prop-types';
|
||||
import { Formik, useField } from 'formik';
|
||||
|
||||
import { t } from '@lingui/macro';
|
||||
import {
|
||||
Button,
|
||||
|
||||
@ -134,7 +134,7 @@ describe('<CredentialPluginPrompt />', () => {
|
||||
wrapper
|
||||
.find('td#check-action-item-1')
|
||||
.find('input')
|
||||
.invoke('onChange')(true);
|
||||
.simulate('click');
|
||||
});
|
||||
wrapper.update();
|
||||
expect(
|
||||
|
||||
@ -267,7 +267,7 @@ describe('NodeModal', () => {
|
||||
wrapper
|
||||
.find('td#check-action-item-1')
|
||||
.find('input')
|
||||
.prop('onChange')(true);
|
||||
.simulate('click');
|
||||
});
|
||||
wrapper.update();
|
||||
await act(async () => {
|
||||
@ -337,7 +337,7 @@ describe('NodeModal', () => {
|
||||
wrapper
|
||||
.find('td#check-action-item-1')
|
||||
.find('input')
|
||||
.prop('onChange')(true);
|
||||
.simulate('click');
|
||||
});
|
||||
wrapper.update();
|
||||
await act(async () => {
|
||||
@ -376,7 +376,7 @@ describe('NodeModal', () => {
|
||||
wrapper
|
||||
.find('td#check-action-item-1')
|
||||
.find('input')
|
||||
.prop('onChange')(true);
|
||||
.simulate('click');
|
||||
});
|
||||
wrapper.update();
|
||||
await act(async () => {
|
||||
@ -415,7 +415,7 @@ describe('NodeModal', () => {
|
||||
wrapper
|
||||
.find('td#check-action-item-1')
|
||||
.find('input')
|
||||
.prop('onChange')(true)
|
||||
.simulate('click')
|
||||
);
|
||||
wrapper.update();
|
||||
|
||||
@ -673,7 +673,7 @@ describe('Edit existing node', () => {
|
||||
newWrapper
|
||||
.find('td#check-action-item-1')
|
||||
.find('input')
|
||||
.prop('onChange')();
|
||||
.simulate('click');
|
||||
newWrapper.update();
|
||||
});
|
||||
newWrapper.update();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user