mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 14:20:12 +00:00
[react-bootstrap-table-next] update tests
This commit is contained in:
@@ -6,6 +6,7 @@ import BootstrapTable, {
|
||||
HeaderFormatter,
|
||||
ColumnDescription,
|
||||
RowSelectionType,
|
||||
ROW_SELECT_SINGLE,
|
||||
} from 'react-bootstrap-table-next';
|
||||
|
||||
interface Product {
|
||||
@@ -48,8 +49,8 @@ const priceFormatter: ColumnFormatter<Product, { indexSquare: number }> = (cell,
|
||||
};
|
||||
|
||||
const productColumns: Array<ColumnDescription<Product>> = [
|
||||
{ dataField: 'id', align: CellAlignment.center, sort: true, text: 'Product ID' },
|
||||
{ dataField: 'name', align: CellAlignment.center, sort: true, text: 'Product Name' },
|
||||
{ dataField: 'id', align: 'center', sort: true, text: 'Product ID' },
|
||||
{ dataField: 'name', align: 'center', sort: true, text: 'Product Name' },
|
||||
{
|
||||
isDummyField: true,
|
||||
dataField: '',
|
||||
@@ -94,8 +95,8 @@ render(
|
||||
hover={true}
|
||||
keyField="id"
|
||||
columns={[
|
||||
{ dataField: 'id', align: CellAlignment.center, sort: true, text: 'Product ID' },
|
||||
{ dataField: 'name', align: CellAlignment.center, sort: true, text: 'Product Name' },
|
||||
{ dataField: 'id', align: 'center', sort: true, text: 'Product ID' },
|
||||
{ dataField: 'name', align: 'center', sort: true, text: 'Product Name' },
|
||||
{
|
||||
isDummyField: true,
|
||||
dataField: '',
|
||||
@@ -115,6 +116,7 @@ render(
|
||||
*/
|
||||
{
|
||||
isDummyField: true,
|
||||
dataField: '',
|
||||
sort: true,
|
||||
formatter: priceFormatter,
|
||||
text: 'Product Price',
|
||||
@@ -152,7 +154,7 @@ render(
|
||||
keyField="id"
|
||||
columns={productColumns}
|
||||
selectRow={{
|
||||
mode: RowSelectionType.ROW_SELECT_SINGLE,
|
||||
mode: ROW_SELECT_SINGLE,
|
||||
}}
|
||||
/>,
|
||||
document.getElementById('app'),
|
||||
|
||||
@@ -59,8 +59,8 @@ const priceFormatter: ColumnFormatter<Product, { indexSquare: number }> = (cell,
|
||||
let priceFilter: any;
|
||||
|
||||
const productColumns: Array<ColumnDescription<Product>> = [
|
||||
{ dataField: 'id', align: CellAlignment.center, sort: true, text: 'Product ID' },
|
||||
{ dataField: 'name', align: CellAlignment.center, sort: true, text: 'Product Name' },
|
||||
{ dataField: 'id', align: 'center', sort: true, text: 'Product ID' },
|
||||
{ dataField: 'name', align: 'center', sort: true, text: 'Product Name' },
|
||||
{
|
||||
isDummyField: true,
|
||||
dataField: '',
|
||||
@@ -94,11 +94,9 @@ const productColumns: Array<ColumnDescription<Product>> = [
|
||||
onFilter: filterValue => {},
|
||||
}),
|
||||
},
|
||||
/**
|
||||
* test optional dataField for dummyFields
|
||||
*/
|
||||
{
|
||||
isDummyField: true,
|
||||
dataField: '',
|
||||
sort: true,
|
||||
formatter: priceFormatter,
|
||||
text: 'Product Price',
|
||||
@@ -146,8 +144,8 @@ render(
|
||||
keyField="id"
|
||||
data={products}
|
||||
columns={[
|
||||
{ dataField: 'id', align: CellAlignment.center, sort: true, text: 'Product ID' },
|
||||
{ dataField: 'name', align: CellAlignment.center, sort: true, text: 'Product Name' },
|
||||
{ dataField: 'id', align: 'center', sort: true, text: 'Product ID' },
|
||||
{ dataField: 'name', align: 'center', sort: true, text: 'Product Name' },
|
||||
{
|
||||
dataField: 'quality',
|
||||
text: 'Product Quailty',
|
||||
@@ -176,11 +174,11 @@ render(
|
||||
keyField="id"
|
||||
data={products}
|
||||
columns={[
|
||||
{ dataField: 'id', align: CellAlignment.center, sort: true, text: 'Product ID' },
|
||||
{ dataField: 'id', align: 'center', sort: true, text: 'Product ID' },
|
||||
{
|
||||
dataField: 'name',
|
||||
formatter: cell => cell,
|
||||
align: CellAlignment.center,
|
||||
align: 'center',
|
||||
sort: true,
|
||||
text: 'Product Name',
|
||||
},
|
||||
|
||||
@@ -49,8 +49,8 @@ const priceFormatter: ColumnFormatter<Product, { indexSquare: number }> = (cell,
|
||||
};
|
||||
|
||||
const productColumns: Array<ColumnDescription<Product>> = [
|
||||
{ dataField: 'id', align: CellAlignment.center, sort: true, text: 'Product ID' },
|
||||
{ dataField: 'name', align: CellAlignment.center, sort: true, text: 'Product Name' },
|
||||
{ dataField: 'id', align: 'center', sort: true, text: 'Product ID' },
|
||||
{ dataField: 'name', align: 'center', sort: true, text: 'Product Name' },
|
||||
{
|
||||
isDummyField: true,
|
||||
dataField: '',
|
||||
@@ -69,6 +69,7 @@ const productColumns: Array<ColumnDescription<Product>> = [
|
||||
*/
|
||||
{
|
||||
isDummyField: true,
|
||||
dataField: '',
|
||||
sort: true,
|
||||
formatter: priceFormatter,
|
||||
text: 'Product Price',
|
||||
|
||||
@@ -50,8 +50,8 @@ const priceFormatter: ColumnFormatter<Product, { indexSquare: number }> = (cell,
|
||||
};
|
||||
|
||||
const productColumns: Array<ColumnDescription<Product>> = [
|
||||
{ dataField: 'id', align: CellAlignment.center, sort: true, text: 'Product ID' },
|
||||
{ dataField: 'name', align: CellAlignment.center, sort: true, text: 'Product Name' },
|
||||
{ dataField: 'id', align: 'center', sort: true, text: 'Product ID' },
|
||||
{ dataField: 'name', align: 'center', sort: true, text: 'Product Name' },
|
||||
{
|
||||
isDummyField: true,
|
||||
dataField: '',
|
||||
@@ -70,6 +70,7 @@ const productColumns: Array<ColumnDescription<Product>> = [
|
||||
*/
|
||||
{
|
||||
isDummyField: true,
|
||||
dataField: '',
|
||||
sort: true,
|
||||
formatter: priceFormatter,
|
||||
text: 'Product Price',
|
||||
|
||||
Reference in New Issue
Block a user