mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 19:30:39 -03:30
swap column types use of shape for exact and fix warnings it found
This commit is contained in:
parent
2c1648f9c9
commit
30b6e318cc
@ -1,7 +1,6 @@
|
||||
import React from 'react';
|
||||
import { createMemoryHistory } from 'history';
|
||||
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||
import { sleep } from '@testUtils/testUtils';
|
||||
import ListHeader from './ListHeader';
|
||||
|
||||
describe('ListHeader', () => {
|
||||
@ -21,7 +20,7 @@ describe('ListHeader', () => {
|
||||
{ name: 'foo', key: 'foo', isDefault: true},
|
||||
]}
|
||||
sortColumns={[
|
||||
{ name: 'foo', key: 'foo', isDefault: true},
|
||||
{ name: 'foo', key: 'foo'},
|
||||
]}
|
||||
renderToolbar={renderToolbarFn}
|
||||
/>
|
||||
@ -42,7 +41,7 @@ describe('ListHeader', () => {
|
||||
{ name: 'foo', key: 'foo', isDefault: true},
|
||||
]}
|
||||
sortColumns={[
|
||||
{ name: 'foo', key: 'foo', isDefault: true},
|
||||
{ name: 'foo', key: 'foo'},
|
||||
]}
|
||||
/>,
|
||||
{ context: { router: { history } } }
|
||||
|
||||
@ -3,7 +3,7 @@ import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||
import { getQSConfig } from '@util/qs';
|
||||
import OptionsList from './OptionsList';
|
||||
|
||||
const qsConfig = getQSConfig('test', {});
|
||||
const qsConfig = getQSConfig('test', { order_by: 'foo' });
|
||||
|
||||
describe('<OptionsList />', () => {
|
||||
it('should display list of options', () => {
|
||||
@ -17,8 +17,8 @@ describe('<OptionsList />', () => {
|
||||
value={[]}
|
||||
options={options}
|
||||
optionCount={3}
|
||||
searchColumns={[]}
|
||||
sortColumns={[]}
|
||||
searchColumns={[{name: 'Foo', key: 'foo', isDefault: true}]}
|
||||
sortColumns={[{ name: 'Foo', key: 'foo' }]}
|
||||
qsConfig={qsConfig}
|
||||
selectItem={() => {}}
|
||||
deselectItem={() => {}}
|
||||
@ -40,8 +40,8 @@ describe('<OptionsList />', () => {
|
||||
value={[options[1]]}
|
||||
options={options}
|
||||
optionCount={3}
|
||||
searchColumns={[]}
|
||||
sortColumns={[]}
|
||||
searchColumns={[{name: 'Foo', key: 'foo', isDefault: true}]}
|
||||
sortColumns={[{ name: 'Foo', key: 'foo' }]}
|
||||
qsConfig={qsConfig}
|
||||
selectItem={() => {}}
|
||||
deselectItem={() => {}}
|
||||
|
||||
@ -181,7 +181,6 @@ class ResourceAccessList extends React.Component {
|
||||
{
|
||||
name: i18n._(t`Username`),
|
||||
key: 'username',
|
||||
isDefault: true
|
||||
},
|
||||
{
|
||||
name: i18n._(t`First Name`),
|
||||
|
||||
@ -186,7 +186,6 @@ function InventoryGroupsList({ i18n, location, match }) {
|
||||
{
|
||||
name: i18n._(t`Is root group`),
|
||||
key: 'parents__isnull',
|
||||
isDefault: true,
|
||||
isBoolean: true
|
||||
},
|
||||
{
|
||||
|
||||
@ -173,7 +173,6 @@ class UsersList extends Component {
|
||||
{
|
||||
name: i18n._(t`Username`),
|
||||
key: 'username',
|
||||
isDefault: true
|
||||
},
|
||||
{
|
||||
name: i18n._(t`First name`),
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import {
|
||||
shape,
|
||||
exact,
|
||||
arrayOf,
|
||||
number,
|
||||
string,
|
||||
@ -251,15 +252,17 @@ export const Group = shape({
|
||||
});
|
||||
|
||||
export const SearchColumns = arrayOf(
|
||||
shape({
|
||||
exact({
|
||||
name: string.isRequired,
|
||||
key: string.isRequired,
|
||||
isDefault: bool,
|
||||
isBoolean: bool,
|
||||
options: arrayOf(arrayOf(string, string))
|
||||
})
|
||||
);
|
||||
|
||||
export const SortColumns = arrayOf(
|
||||
shape({
|
||||
exact({
|
||||
name: string.isRequired,
|
||||
key: string.isRequired,
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user