mirror of
https://github.com/gosticks/react-bootstrap-table2.git
synced 2025-10-16 11:55:39 +00:00
always jsx-curly-spacing
This commit is contained in:
parent
4f7a3d7eaf
commit
0440c63c66
@ -11,7 +11,7 @@
|
|||||||
],
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
"comma-dangle": ["error", "never"],
|
"comma-dangle": ["error", "never"],
|
||||||
"react/jsx-curly-spacing": 0,
|
"react/jsx-curly-spacing": [2, "always"],
|
||||||
"react/forbid-prop-types": 0,
|
"react/forbid-prop-types": 0,
|
||||||
"react/jsx-filename-extension": 0,
|
"react/jsx-filename-extension": 0,
|
||||||
"react/jsx-space-before-closing": 0,
|
"react/jsx-space-before-closing": 0,
|
||||||
|
|||||||
@ -36,12 +36,12 @@ const CaptionElement = () => <h3 style={{ borderRadius: '0.25em', textAlign: 'ce
|
|||||||
<BootstrapTable keyField="id" data={ products } caption={<CaptionElement />} columns={ columns } />
|
<BootstrapTable keyField="id" data={ products } caption={<CaptionElement />} columns={ columns } />
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const Caption = () => <h3 style={{ borderRadius: '0.25em', textAlign: 'center', color: 'purple', border: '1px solid purple', padding: '0.5em' }}>Component as Header</h3>;
|
const Caption = () => <h3 style={ { borderRadius: '0.25em', textAlign: 'center', color: 'purple', border: '1px solid purple', padding: '0.5em' } }>Component as Header</h3>;
|
||||||
|
|
||||||
export default () => (
|
export default () => (
|
||||||
<div>
|
<div>
|
||||||
<BootstrapTable keyField="id" data={ products } caption="Plain text header" columns={ columns } />
|
<BootstrapTable keyField="id" data={ products } caption="Plain text header" columns={ columns } />
|
||||||
<BootstrapTable keyField="id" data={ products } caption={<Caption />} columns={ columns } />
|
<BootstrapTable keyField="id" data={ products } caption={ <Caption /> } columns={ columns } />
|
||||||
<Code>{ sourceCode }</Code>
|
<Code>{ sourceCode }</Code>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -203,7 +203,7 @@ const reducers = (state, action) => {
|
|||||||
const store = createStore(reducers, initialState, applyMiddleware(thunk));
|
const store = createStore(reducers, initialState, applyMiddleware(thunk));
|
||||||
|
|
||||||
const Index = () => (
|
const Index = () => (
|
||||||
<Provider store={store}>
|
<Provider store={ store }>
|
||||||
<CellEditWithRedux />
|
<CellEditWithRedux />
|
||||||
</Provider>
|
</Provider>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -24,13 +24,13 @@ export default class Welcome extends React.Component {
|
|||||||
<h1 className="welcome-title">react-bootstrap-table2</h1>
|
<h1 className="welcome-title">react-bootstrap-table2</h1>
|
||||||
<span
|
<span
|
||||||
className="welcome-sub-title"
|
className="welcome-sub-title"
|
||||||
ref={(el) => { this.el = el; }}
|
ref={ (el) => { this.el = el; } }
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<a href="https://github.com/react-bootstrap-table/react-bootstrap-table2" className="github-corner" aria-label="View source on Github">
|
<a href="https://github.com/react-bootstrap-table/react-bootstrap-table2" className="github-corner" aria-label="View source on Github">
|
||||||
<svg width="80" height="80" viewBox="0 0 250 250" style={{ fill: '#009688', color: '#fff', position: 'absolute', top: '0', border: '0', right: '0' }} aria-hidden="true">
|
<svg width="80" height="80" viewBox="0 0 250 250" style={ { fill: '#009688', color: '#fff', position: 'absolute', top: '0', border: '0', right: '0' } } aria-hidden="true">
|
||||||
<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z" />
|
<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z" />
|
||||||
<path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style={{ transformOrigin: '130px 106px' }} className="octo-arm" />
|
<path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style={ { transformOrigin: '130px 106px' } } className="octo-arm" />
|
||||||
<path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" className="octo-body" />
|
<path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" className="octo-body" />
|
||||||
</svg>
|
</svg>
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@ -81,8 +81,8 @@ class BootstrapTable extends PropsBaseResolver(Component) {
|
|||||||
visibleColumnSize={ this.visibleColumnSize() }
|
visibleColumnSize={ this.visibleColumnSize() }
|
||||||
noDataIndication={ noDataIndication }
|
noDataIndication={ noDataIndication }
|
||||||
cellEdit={ cellEditInfo }
|
cellEdit={ cellEditInfo }
|
||||||
selectRow={cellSelectionInfo}
|
selectRow={ cellSelectionInfo }
|
||||||
selectedRowKeys={store.getSelectedRowKeys()}
|
selectedRowKeys={ store.getSelectedRowKeys() }
|
||||||
/>
|
/>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -21,7 +21,7 @@ const Header = (props) => {
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
{
|
{
|
||||||
selectRow.mode === ROW_SELECT_DISABLED ? null : <SelectionHeaderCell {...selectRow} />
|
selectRow.mode === ROW_SELECT_DISABLED ? null : <SelectionHeaderCell { ...selectRow } />
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
columns.map((column, i) => {
|
columns.map((column, i) => {
|
||||||
|
|||||||
@ -48,10 +48,10 @@ export default class SelectionCell extends Component {
|
|||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<td onClick={this.handleRowClick}>
|
<td onClick={ this.handleRowClick }>
|
||||||
<input
|
<input
|
||||||
type={inputType}
|
type={ inputType }
|
||||||
checked={selected}
|
checked={ selected }
|
||||||
/>
|
/>
|
||||||
</td>
|
</td>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -6,10 +6,10 @@ import Const from '../const';
|
|||||||
export const CheckBox = ({ checked, indeterminate }) => (
|
export const CheckBox = ({ checked, indeterminate }) => (
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
checked={checked}
|
checked={ checked }
|
||||||
ref={(input) => {
|
ref={ (input) => {
|
||||||
if (input) input.indeterminate = indeterminate; // eslint-disable-line no-param-reassign
|
if (input) input.indeterminate = indeterminate; // eslint-disable-line no-param-reassign
|
||||||
}}
|
} }
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -64,11 +64,11 @@ export default class SelectionHeaderCell extends Component {
|
|||||||
return mode === ROW_SELECT_SINGLE
|
return mode === ROW_SELECT_SINGLE
|
||||||
? <th data-row-selection />
|
? <th data-row-selection />
|
||||||
: (
|
: (
|
||||||
<th data-row-selection onClick={this.handleCheckBoxClick}>
|
<th data-row-selection onClick={ this.handleCheckBoxClick }>
|
||||||
<CheckBox
|
<CheckBox
|
||||||
{...this.props}
|
{ ...this.props }
|
||||||
checked={checked}
|
checked={ checked }
|
||||||
indeterminate={indeterminate}
|
indeterminate={ indeterminate }
|
||||||
/>
|
/>
|
||||||
</th>
|
</th>
|
||||||
);
|
);
|
||||||
|
|||||||
4
packages/react-bootstrap-table2/src/row.js
vendored
4
packages/react-bootstrap-table2/src/row.js
vendored
@ -38,8 +38,8 @@ const Row = (props) => {
|
|||||||
: (
|
: (
|
||||||
<SelectionCell
|
<SelectionCell
|
||||||
{ ...selectRow }
|
{ ...selectRow }
|
||||||
rowKey={_.get(row, keyField)}
|
rowKey={ _.get(row, keyField) }
|
||||||
selected={selected}
|
selected={ selected }
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,7 +28,7 @@ describe('Body', () => {
|
|||||||
|
|
||||||
describe('simplest body', () => {
|
describe('simplest body', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
wrapper = shallow(<Body {...mockBodyResolvedProps} keyField="id" columns={ columns } data={ data } />);
|
wrapper = shallow(<Body { ...mockBodyResolvedProps } keyField="id" columns={ columns } data={ data } />);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render successfully', () => {
|
it('should render successfully', () => {
|
||||||
@ -42,7 +42,7 @@ describe('Body', () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
wrapper = shallow(
|
wrapper = shallow(
|
||||||
<Body
|
<Body
|
||||||
{...mockBodyResolvedProps}
|
{ ...mockBodyResolvedProps }
|
||||||
keyField="id"
|
keyField="id"
|
||||||
columns={ columns }
|
columns={ columns }
|
||||||
data={ data }
|
data={ data }
|
||||||
@ -67,7 +67,7 @@ describe('Body', () => {
|
|||||||
emptyIndication = 'Table is empty';
|
emptyIndication = 'Table is empty';
|
||||||
wrapper = shallow(
|
wrapper = shallow(
|
||||||
<Body
|
<Body
|
||||||
{...mockBodyResolvedProps}
|
{ ...mockBodyResolvedProps }
|
||||||
keyField="id"
|
keyField="id"
|
||||||
columns={ columns }
|
columns={ columns }
|
||||||
data={ data }
|
data={ data }
|
||||||
@ -93,7 +93,7 @@ describe('Body', () => {
|
|||||||
emptyIndicationCallBack = sinon.stub().returns(content);
|
emptyIndicationCallBack = sinon.stub().returns(content);
|
||||||
wrapper = shallow(
|
wrapper = shallow(
|
||||||
<Body
|
<Body
|
||||||
{...mockBodyResolvedProps}
|
{ ...mockBodyResolvedProps }
|
||||||
keyField="id"
|
keyField="id"
|
||||||
columns={ columns }
|
columns={ columns }
|
||||||
data={ data }
|
data={ data }
|
||||||
@ -127,7 +127,7 @@ describe('Body', () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
wrapper = shallow(
|
wrapper = shallow(
|
||||||
<Body
|
<Body
|
||||||
{...mockBodyResolvedProps}
|
{ ...mockBodyResolvedProps }
|
||||||
data={ data }
|
data={ data }
|
||||||
columns={ columns }
|
columns={ columns }
|
||||||
keyField={ keyField }
|
keyField={ keyField }
|
||||||
@ -156,12 +156,12 @@ describe('Body', () => {
|
|||||||
it('props selected should be true if all rows were selected', () => {
|
it('props selected should be true if all rows were selected', () => {
|
||||||
wrapper = shallow(
|
wrapper = shallow(
|
||||||
<Body
|
<Body
|
||||||
{...mockBodyResolvedProps}
|
{ ...mockBodyResolvedProps }
|
||||||
data={ data }
|
data={ data }
|
||||||
columns={ columns }
|
columns={ columns }
|
||||||
keyField={ keyField }
|
keyField={ keyField }
|
||||||
selectedRowKeys={[1, 2]}
|
selectedRowKeys={ [1, 2] }
|
||||||
selectRow={selectRow}
|
selectRow={ selectRow }
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -171,12 +171,12 @@ describe('Body', () => {
|
|||||||
it('props selected should be false if all rows were not selected', () => {
|
it('props selected should be false if all rows were not selected', () => {
|
||||||
wrapper = shallow(
|
wrapper = shallow(
|
||||||
<Body
|
<Body
|
||||||
{...mockBodyResolvedProps}
|
{ ...mockBodyResolvedProps }
|
||||||
data={ data }
|
data={ data }
|
||||||
columns={ columns }
|
columns={ columns }
|
||||||
keyField={ keyField }
|
keyField={ keyField }
|
||||||
selectedRowKeys={[]}
|
selectedRowKeys={ [] }
|
||||||
selectRow={selectRow}
|
selectRow={ selectRow }
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -189,11 +189,11 @@ describe('Body', () => {
|
|||||||
const keyField = 'id';
|
const keyField = 'id';
|
||||||
wrapper = shallow(
|
wrapper = shallow(
|
||||||
<Body
|
<Body
|
||||||
{...mockBodyResolvedProps}
|
{ ...mockBodyResolvedProps }
|
||||||
data={ data }
|
data={ data }
|
||||||
columns={ columns }
|
columns={ columns }
|
||||||
keyField={ keyField }
|
keyField={ keyField }
|
||||||
selectedRowKeys={[]}
|
selectedRowKeys={ [] }
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -19,7 +19,7 @@ describe('Header', () => {
|
|||||||
|
|
||||||
describe('simplest header', () => {
|
describe('simplest header', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
wrapper = shallow(<Header {...mockHeaderResolvedProps} columns={ columns } />);
|
wrapper = shallow(<Header { ...mockHeaderResolvedProps } columns={ columns } />);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render successfully', () => {
|
it('should render successfully', () => {
|
||||||
@ -35,7 +35,7 @@ describe('Header', () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
wrapper = shallow(
|
wrapper = shallow(
|
||||||
<Header
|
<Header
|
||||||
{...mockHeaderResolvedProps}
|
{ ...mockHeaderResolvedProps }
|
||||||
columns={ columns }
|
columns={ columns }
|
||||||
sortField={ sortField }
|
sortField={ sortField }
|
||||||
sortOrder={ Const.SORT_ASC }
|
sortOrder={ Const.SORT_ASC }
|
||||||
@ -53,7 +53,7 @@ describe('Header', () => {
|
|||||||
|
|
||||||
describe('when the selectRow.mode is radio(single selection)', () => {
|
describe('when the selectRow.mode is radio(single selection)', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
wrapper = shallow(<Header {...mockHeaderResolvedProps} columns={ columns } />);
|
wrapper = shallow(<Header { ...mockHeaderResolvedProps } columns={ columns } />);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not render <SelectionHeaderCell />', () => {
|
it('should not render <SelectionHeaderCell />', () => {
|
||||||
@ -66,9 +66,9 @@ describe('Header', () => {
|
|||||||
const selectRow = { mode: 'checkbox' };
|
const selectRow = { mode: 'checkbox' };
|
||||||
wrapper = shallow(
|
wrapper = shallow(
|
||||||
<Header
|
<Header
|
||||||
{...mockHeaderResolvedProps}
|
{ ...mockHeaderResolvedProps }
|
||||||
columns={ columns }
|
columns={ columns }
|
||||||
selectRow={selectRow}
|
selectRow={ selectRow }
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -16,7 +16,7 @@ describe('<SelectionCell />', () => {
|
|||||||
it('should not update component', () => {
|
it('should not update component', () => {
|
||||||
const nextProps = { selected };
|
const nextProps = { selected };
|
||||||
|
|
||||||
wrapper = shallow(<SelectionCell rowKey={1} mode={mode} selected={selected} />);
|
wrapper = shallow(<SelectionCell rowKey={ 1 } mode={ mode } selected={ selected } />);
|
||||||
|
|
||||||
expect(wrapper.instance().shouldComponentUpdate(nextProps)).toBe(false);
|
expect(wrapper.instance().shouldComponentUpdate(nextProps)).toBe(false);
|
||||||
});
|
});
|
||||||
@ -26,7 +26,7 @@ describe('<SelectionCell />', () => {
|
|||||||
it('should update component', () => {
|
it('should update component', () => {
|
||||||
const nextProps = { selected: !selected };
|
const nextProps = { selected: !selected };
|
||||||
|
|
||||||
wrapper = shallow(<SelectionCell rowKey={1} mode={mode} selected={selected} />);
|
wrapper = shallow(<SelectionCell rowKey={ 1 } mode={ mode } selected={ selected } />);
|
||||||
|
|
||||||
expect(wrapper.instance().shouldComponentUpdate(nextProps)).toBe(true);
|
expect(wrapper.instance().shouldComponentUpdate(nextProps)).toBe(true);
|
||||||
});
|
});
|
||||||
@ -48,9 +48,9 @@ describe('<SelectionCell />', () => {
|
|||||||
wrapper = shallow(
|
wrapper = shallow(
|
||||||
<SelectionCell
|
<SelectionCell
|
||||||
selected
|
selected
|
||||||
rowKey={rowKey}
|
rowKey={ rowKey }
|
||||||
mode={mode}
|
mode={ mode }
|
||||||
onRowSelect={mockOnRowSelect}
|
onRowSelect={ mockOnRowSelect }
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -65,9 +65,9 @@ describe('<SelectionCell />', () => {
|
|||||||
wrapper = shallow(
|
wrapper = shallow(
|
||||||
<SelectionCell
|
<SelectionCell
|
||||||
selected
|
selected
|
||||||
rowKey={rowKey}
|
rowKey={ rowKey }
|
||||||
mode="radio"
|
mode="radio"
|
||||||
onRowSelect={mockOnRowSelect}
|
onRowSelect={ mockOnRowSelect }
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@ -89,9 +89,9 @@ describe('<SelectionCell />', () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
wrapper = shallow(
|
wrapper = shallow(
|
||||||
<SelectionCell
|
<SelectionCell
|
||||||
rowKey={rowKey}
|
rowKey={ rowKey }
|
||||||
mode="checkbox"
|
mode="checkbox"
|
||||||
onRowSelect={mockOnRowSelect}
|
onRowSelect={ mockOnRowSelect }
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@ -119,9 +119,9 @@ describe('<SelectionCell />', () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
wrapper = shallow(
|
wrapper = shallow(
|
||||||
<SelectionCell
|
<SelectionCell
|
||||||
rowKey={1}
|
rowKey={ 1 }
|
||||||
mode={mode}
|
mode={ mode }
|
||||||
selected={selected}
|
selected={ selected }
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -24,7 +24,7 @@ describe('<SelectionHeaderCell />', () => {
|
|||||||
const nextProps = { checkedStatus };
|
const nextProps = { checkedStatus };
|
||||||
|
|
||||||
wrapper = shallow(
|
wrapper = shallow(
|
||||||
<SelectionHeaderCell mode="checkbox" checkedStatus={checkedStatus} />);
|
<SelectionHeaderCell mode="checkbox" checkedStatus={ checkedStatus } />);
|
||||||
|
|
||||||
expect(wrapper.instance().shouldComponentUpdate(nextProps)).toBe(false);
|
expect(wrapper.instance().shouldComponentUpdate(nextProps)).toBe(false);
|
||||||
});
|
});
|
||||||
@ -37,7 +37,7 @@ describe('<SelectionHeaderCell />', () => {
|
|||||||
const nextProps = { checkedStatus };
|
const nextProps = { checkedStatus };
|
||||||
|
|
||||||
wrapper = shallow(
|
wrapper = shallow(
|
||||||
<SelectionHeaderCell mode="checkbox" checkedStatus={CHECKBOX_STATUS_INDETERMINATE} />);
|
<SelectionHeaderCell mode="checkbox" checkedStatus={ CHECKBOX_STATUS_INDETERMINATE } />);
|
||||||
|
|
||||||
expect(wrapper.instance().shouldComponentUpdate(nextProps)).toBe(true);
|
expect(wrapper.instance().shouldComponentUpdate(nextProps)).toBe(true);
|
||||||
});
|
});
|
||||||
@ -60,8 +60,8 @@ describe('<SelectionHeaderCell />', () => {
|
|||||||
wrapper = shallow(
|
wrapper = shallow(
|
||||||
<SelectionHeaderCell
|
<SelectionHeaderCell
|
||||||
mode="radio"
|
mode="radio"
|
||||||
checkedStatus={Const.CHECKBOX_STATUS_CHECKED}
|
checkedStatus={ Const.CHECKBOX_STATUS_CHECKED }
|
||||||
onAllRowsSelect={mockOnAllRowsSelect}
|
onAllRowsSelect={ mockOnAllRowsSelect }
|
||||||
/>);
|
/>);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -78,8 +78,8 @@ describe('<SelectionHeaderCell />', () => {
|
|||||||
wrapper = shallow(
|
wrapper = shallow(
|
||||||
<SelectionHeaderCell
|
<SelectionHeaderCell
|
||||||
mode="checkbox"
|
mode="checkbox"
|
||||||
checkedStatus={Const.CHECKBOX_STATUS_CHECKED}
|
checkedStatus={ Const.CHECKBOX_STATUS_CHECKED }
|
||||||
onAllRowsSelect={mockOnAllRowsSelect}
|
onAllRowsSelect={ mockOnAllRowsSelect }
|
||||||
/>);
|
/>);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -98,7 +98,7 @@ describe('<SelectionHeaderCell />', () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
const checkedStatus = Const.CHECKBOX_STATUS_CHECKED;
|
const checkedStatus = Const.CHECKBOX_STATUS_CHECKED;
|
||||||
|
|
||||||
wrapper = shallow(<SelectionHeaderCell mode="radio" checkedStatus={checkedStatus} />);
|
wrapper = shallow(<SelectionHeaderCell mode="radio" checkedStatus={ checkedStatus } />);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not render checkbox', () => {
|
it('should not render checkbox', () => {
|
||||||
@ -112,7 +112,7 @@ describe('<SelectionHeaderCell />', () => {
|
|||||||
const checkedStatus = Const.CHECKBOX_STATUS_CHECKED;
|
const checkedStatus = Const.CHECKBOX_STATUS_CHECKED;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
wrapper = shallow(<SelectionHeaderCell mode="checkbox" checkedStatus={checkedStatus} />);
|
wrapper = shallow(<SelectionHeaderCell mode="checkbox" checkedStatus={ checkedStatus } />);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render checkbox', () => {
|
it('should render checkbox', () => {
|
||||||
@ -134,7 +134,7 @@ describe('<CheckBox />', () => {
|
|||||||
it('should render component correctly', () => {
|
it('should render component correctly', () => {
|
||||||
const checked = true;
|
const checked = true;
|
||||||
const indeterminate = false;
|
const indeterminate = false;
|
||||||
wrapper = shallow(<CheckBox checked={checked} indeterminate={indeterminate} />);
|
wrapper = shallow(<CheckBox checked={ checked } indeterminate={ indeterminate } />);
|
||||||
|
|
||||||
expect(wrapper.find('input').length).toBe(1);
|
expect(wrapper.find('input').length).toBe(1);
|
||||||
expect(wrapper.find('input').prop('checked')).toBe(checked);
|
expect(wrapper.find('input').prop('checked')).toBe(checked);
|
||||||
|
|||||||
@ -32,7 +32,7 @@ describe('Row', () => {
|
|||||||
describe('simplest row', () => {
|
describe('simplest row', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
wrapper = shallow(
|
wrapper = shallow(
|
||||||
<Row {...mockBodyResolvedProps} rowIndex={ 1 } columns={ defaultColumns } row={ row } />);
|
<Row { ...mockBodyResolvedProps } rowIndex={ 1 } columns={ defaultColumns } row={ row } />);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render successfully', () => {
|
it('should render successfully', () => {
|
||||||
@ -55,7 +55,7 @@ describe('Row', () => {
|
|||||||
};
|
};
|
||||||
wrapper = shallow(
|
wrapper = shallow(
|
||||||
<Row
|
<Row
|
||||||
{...mockBodyResolvedProps}
|
{ ...mockBodyResolvedProps }
|
||||||
row={ row }
|
row={ row }
|
||||||
rowIndex={ rowIndex }
|
rowIndex={ rowIndex }
|
||||||
columns={ columns }
|
columns={ columns }
|
||||||
@ -95,7 +95,7 @@ describe('Row', () => {
|
|||||||
columns[nonEditableColIndex].editable = false;
|
columns[nonEditableColIndex].editable = false;
|
||||||
wrapper = shallow(
|
wrapper = shallow(
|
||||||
<Row
|
<Row
|
||||||
{...mockBodyResolvedProps}
|
{ ...mockBodyResolvedProps }
|
||||||
row={ row }
|
row={ row }
|
||||||
rowIndex={ rowIndex }
|
rowIndex={ rowIndex }
|
||||||
columns={ columns }
|
columns={ columns }
|
||||||
@ -132,7 +132,7 @@ describe('Row', () => {
|
|||||||
columns[nonEditableColIndex].editable = editableCallBack;
|
columns[nonEditableColIndex].editable = editableCallBack;
|
||||||
wrapper = shallow(
|
wrapper = shallow(
|
||||||
<Row
|
<Row
|
||||||
{...mockBodyResolvedProps}
|
{ ...mockBodyResolvedProps }
|
||||||
row={ row }
|
row={ row }
|
||||||
rowIndex={ rowIndex }
|
rowIndex={ rowIndex }
|
||||||
columns={ columns }
|
columns={ columns }
|
||||||
@ -165,7 +165,7 @@ describe('Row', () => {
|
|||||||
columns[nonEditableColIndex].editable = editableCallBack;
|
columns[nonEditableColIndex].editable = editableCallBack;
|
||||||
wrapper = shallow(
|
wrapper = shallow(
|
||||||
<Row
|
<Row
|
||||||
{...mockBodyResolvedProps}
|
{ ...mockBodyResolvedProps }
|
||||||
row={ row }
|
row={ row }
|
||||||
rowIndex={ rowIndex }
|
rowIndex={ rowIndex }
|
||||||
columns={ columns }
|
columns={ columns }
|
||||||
@ -199,7 +199,7 @@ describe('Row', () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
wrapper = shallow(
|
wrapper = shallow(
|
||||||
<Row
|
<Row
|
||||||
{...mockBodyResolvedProps}
|
{ ...mockBodyResolvedProps }
|
||||||
row={ row }
|
row={ row }
|
||||||
rowIndex={ rowIndex }
|
rowIndex={ rowIndex }
|
||||||
columns={ columns }
|
columns={ columns }
|
||||||
@ -230,7 +230,7 @@ describe('Row', () => {
|
|||||||
cellEdit.onUpdate = sinon.stub();
|
cellEdit.onUpdate = sinon.stub();
|
||||||
wrapper = shallow(
|
wrapper = shallow(
|
||||||
<Row
|
<Row
|
||||||
{...mockBodyResolvedProps}
|
{ ...mockBodyResolvedProps }
|
||||||
row={ row }
|
row={ row }
|
||||||
rowIndex={ 1 }
|
rowIndex={ 1 }
|
||||||
columns={ columns }
|
columns={ columns }
|
||||||
@ -260,7 +260,7 @@ describe('Row', () => {
|
|||||||
cellEdit.onEscape = sinon.stub();
|
cellEdit.onEscape = sinon.stub();
|
||||||
wrapper = shallow(
|
wrapper = shallow(
|
||||||
<Row
|
<Row
|
||||||
{...mockBodyResolvedProps}
|
{ ...mockBodyResolvedProps }
|
||||||
row={ row }
|
row={ row }
|
||||||
rowIndex={ 1 }
|
rowIndex={ 1 }
|
||||||
columns={ columns }
|
columns={ columns }
|
||||||
@ -283,7 +283,7 @@ describe('Row', () => {
|
|||||||
describe('when selectRow.mode is ROW_SELECT_DISABLED (row was un-selectable)', () => {
|
describe('when selectRow.mode is ROW_SELECT_DISABLED (row was un-selectable)', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
wrapper = shallow(
|
wrapper = shallow(
|
||||||
<Row {...mockBodyResolvedProps} rowIndex={ 1 } columns={ defaultColumns } row={ row } />);
|
<Row { ...mockBodyResolvedProps } rowIndex={ 1 } columns={ defaultColumns } row={ row } />);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not render <SelectionCell />', () => {
|
it('should not render <SelectionCell />', () => {
|
||||||
@ -296,11 +296,11 @@ describe('Row', () => {
|
|||||||
const selectRow = { mode: 'checkbox' };
|
const selectRow = { mode: 'checkbox' };
|
||||||
wrapper = shallow(
|
wrapper = shallow(
|
||||||
<Row
|
<Row
|
||||||
{...mockBodyResolvedProps}
|
{ ...mockBodyResolvedProps }
|
||||||
rowIndex={ 1 }
|
rowIndex={ 1 }
|
||||||
columns={ defaultColumns }
|
columns={ defaultColumns }
|
||||||
row={ row }
|
row={ row }
|
||||||
selectRow={selectRow}
|
selectRow={ selectRow }
|
||||||
/>);
|
/>);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user