mirror of
https://github.com/ansible/awx.git
synced 2026-01-20 14:11:24 -03:30
Prettier
This commit is contained in:
parent
c294a63f32
commit
823a74c98b
@ -175,7 +175,8 @@ class HostsList extends Component {
|
||||
|
||||
const canAdd =
|
||||
actions && Object.prototype.hasOwnProperty.call(actions, 'POST');
|
||||
const isAllSelected = selected.length > 0 && selected.length === hosts.length;
|
||||
const isAllSelected =
|
||||
selected.length > 0 && selected.length === hosts.length;
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
|
||||
@ -174,7 +174,8 @@ class InventoriesList extends Component {
|
||||
const { match, i18n } = this.props;
|
||||
const canAdd =
|
||||
actions && Object.prototype.hasOwnProperty.call(actions, 'POST');
|
||||
const isAllSelected = selected.length > 0 && selected.length === inventories.length;
|
||||
const isAllSelected =
|
||||
selected.length > 0 && selected.length === inventories.length;
|
||||
return (
|
||||
<PageSection>
|
||||
<Card>
|
||||
|
||||
@ -141,7 +141,8 @@ class ProjectsList extends Component {
|
||||
|
||||
const canAdd =
|
||||
actions && Object.prototype.hasOwnProperty.call(actions, 'POST');
|
||||
const isAllSelected = selected.length > 0 && selected.length === projects.length;
|
||||
const isAllSelected =
|
||||
selected.length > 0 && selected.length === projects.length;
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
|
||||
@ -16,10 +16,10 @@ import TeamEdit from './TeamEdit';
|
||||
import { TeamsAPI } from '@api';
|
||||
|
||||
const CardHeader = styled(PFCardHeader)`
|
||||
--pf-c-card--first-child--PaddingTop: 0;
|
||||
--pf-c-card--child--PaddingLeft: 0;
|
||||
--pf-c-card--child--PaddingRight: 0;
|
||||
position: relative;
|
||||
--pf-c-card--first-child--PaddingTop: 0;
|
||||
--pf-c-card--child--PaddingLeft: 0;
|
||||
--pf-c-card--child--PaddingRight: 0;
|
||||
position: relative;
|
||||
`;
|
||||
|
||||
class Team extends Component {
|
||||
|
||||
@ -139,7 +139,8 @@ class TeamsList extends Component {
|
||||
|
||||
const canAdd =
|
||||
actions && Object.prototype.hasOwnProperty.call(actions, 'POST');
|
||||
const isAllSelected = selected.length > 0 && selected.length === teams.length;
|
||||
const isAllSelected =
|
||||
selected.length > 0 && selected.length === teams.length;
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
|
||||
@ -77,14 +77,23 @@ describe('<TeamsList />', () => {
|
||||
'TeamsList',
|
||||
el => el.state('hasContentLoading') === false
|
||||
);
|
||||
expect(wrapper.find('input[type="checkbox"]').findWhere(n => n.prop('checked') === true).length).toBe(0);
|
||||
expect(
|
||||
wrapper
|
||||
.find('input[type="checkbox"]')
|
||||
.findWhere(n => n.prop('checked') === true).length
|
||||
).toBe(0);
|
||||
wrapper
|
||||
.find('TeamListItem').at(0)
|
||||
.find('TeamListItem')
|
||||
.at(0)
|
||||
.find('DataListCheck')
|
||||
.props()
|
||||
.onChange(true);
|
||||
wrapper.update();
|
||||
expect(wrapper.find('input[type="checkbox"]').findWhere(n => n.prop('checked') === true).length).toBe(1);
|
||||
expect(
|
||||
wrapper
|
||||
.find('input[type="checkbox"]')
|
||||
.findWhere(n => n.prop('checked') === true).length
|
||||
).toBe(1);
|
||||
});
|
||||
|
||||
test('Select all checkbox selects and unselects all rows', async () => {
|
||||
@ -94,19 +103,31 @@ describe('<TeamsList />', () => {
|
||||
'TeamsList',
|
||||
el => el.state('hasContentLoading') === false
|
||||
);
|
||||
expect(wrapper.find('input[type="checkbox"]').findWhere(n => n.prop('checked') === true).length).toBe(0);
|
||||
expect(
|
||||
wrapper
|
||||
.find('input[type="checkbox"]')
|
||||
.findWhere(n => n.prop('checked') === true).length
|
||||
).toBe(0);
|
||||
wrapper
|
||||
.find('Checkbox#select-all')
|
||||
.props()
|
||||
.onChange(true);
|
||||
wrapper.update();
|
||||
expect(wrapper.find('input[type="checkbox"]').findWhere(n => n.prop('checked') === true).length).toBe(4);
|
||||
expect(
|
||||
wrapper
|
||||
.find('input[type="checkbox"]')
|
||||
.findWhere(n => n.prop('checked') === true).length
|
||||
).toBe(4);
|
||||
wrapper
|
||||
.find('Checkbox#select-all')
|
||||
.props()
|
||||
.onChange(false);
|
||||
wrapper.update();
|
||||
expect(wrapper.find('input[type="checkbox"]').findWhere(n => n.prop('checked') === true).length).toBe(0);
|
||||
expect(
|
||||
wrapper
|
||||
.find('input[type="checkbox"]')
|
||||
.findWhere(n => n.prop('checked') === true).length
|
||||
).toBe(0);
|
||||
});
|
||||
|
||||
test('api is called to delete Teams for each team in selected.', () => {
|
||||
|
||||
@ -42,10 +42,7 @@ class TeamListItem extends React.Component {
|
||||
dataListCells={[
|
||||
<DataListCell key="divider">
|
||||
<VerticalSeparator />
|
||||
<Link
|
||||
id={labelId}
|
||||
to={`${detailUrl}`}
|
||||
>
|
||||
<Link id={labelId} to={`${detailUrl}`}>
|
||||
<b>{team.name}</b>
|
||||
</Link>
|
||||
</DataListCell>,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user