mirror of
https://github.com/gosticks/react-bootstrap-table2.git
synced 2026-06-29 05:30:05 +00:00
Compare commits
2 Commits
react-boot
...
react-boot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
765a49fb07 | ||
|
|
fe2fd93c20 |
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "react-bootstrap-table-next",
|
||||
"version": "0.1.11",
|
||||
"version": "0.1.12",
|
||||
"description": "Next generation of react-bootstrap-table",
|
||||
"main": "./lib/index.js",
|
||||
"repository": {
|
||||
|
||||
4
packages/react-bootstrap-table2/src/cell.js
vendored
4
packages/react-bootstrap-table2/src/cell.js
vendored
@@ -88,7 +88,9 @@ class Cell extends Component {
|
||||
cellAttrs.onDoubleClick = this.handleEditingCell;
|
||||
}
|
||||
return (
|
||||
<td { ...cellAttrs }>{ content }</td>
|
||||
<td { ...cellAttrs }>
|
||||
{ typeof content === 'boolean' ? `${content}` : content }
|
||||
</td>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,25 @@ describe('Cell', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('when content is bool value', () => {
|
||||
const column = {
|
||||
dataField: 'col1',
|
||||
text: 'column 1'
|
||||
};
|
||||
const aRowWithBoolValue = { col1: true };
|
||||
|
||||
beforeEach(() => {
|
||||
wrapper = shallow(
|
||||
<Cell row={ aRowWithBoolValue } columnIndex={ 1 } rowIndex={ 1 } column={ column } />
|
||||
);
|
||||
});
|
||||
|
||||
it('should render successfully', () => {
|
||||
expect(wrapper.length).toBe(1);
|
||||
expect(wrapper.text()).toEqual(aRowWithBoolValue[column.dataField].toString());
|
||||
});
|
||||
});
|
||||
|
||||
describe('when column.formatter prop is defined', () => {
|
||||
const rowIndex = 1;
|
||||
const column = {
|
||||
|
||||
Reference in New Issue
Block a user