Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
refine #78
  • Loading branch information
AllenFang committed Oct 10, 2017
commit c92ebaec71af569c546ba22c784df9995b2c0251
4 changes: 2 additions & 2 deletions packages/react-bootstrap-table2-example/stories/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import BasicTable from 'examples/basic';
import BorderlessTable from 'examples/basic/borderless-table';
import StripHoverCondensedTable from 'examples/basic/striped-hover-condensed-table';
import NoDataTable from 'examples/basic/no-data-table';
import TableWithCaption from 'examples/basic/table-with-caption';
import CaptionTable from 'examples/basic/caption-table';

// work on columns
import NestedDataTable from 'examples/columns/nested-data-table';
Expand Down Expand Up @@ -63,7 +63,7 @@ storiesOf('Basic Table', module)
.add('striped, hover, condensed table', () => <StripHoverCondensedTable />)
.add('borderless table', () => <BorderlessTable />)
.add('Indication For Empty Table', () => <NoDataTable />)
.add('Table with caption', () => <TableWithCaption />);
.add('Table with caption', () => <CaptionTable />);

storiesOf('Work on Columns', module)
.add('Display Nested Data', () => <NestedDataTable />)
Expand Down
14 changes: 12 additions & 2 deletions packages/react-bootstrap-table2/test/bootstrap-table.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import sinon from 'sinon';
import { shallow } from 'enzyme';

import Caption from '../src/caption';
import Header from '../src/header';
import Body from '../src/body';
import BootstrapTable from '../src/bootstrap-table';
Expand Down Expand Up @@ -91,10 +92,19 @@ describe('BootstrapTable', () => {

describe('when table should have a caption', () => {
beforeEach(() => {
wrapper = shallow(<BootstrapTable caption={<span className="table-caption">test</span>} keyField="id" columns={ columns } data={ data } bordered={ false } />);
wrapper = shallow(
<BootstrapTable
caption={ <span className="table-caption">test</span> }
keyField="id"
columns={ columns }
data={ data }
bordered={ false }
/>
);
});

it('should render caption', () => {
it('should render caption correctly', () => {
expect(wrapper.find(Caption).length).toBe(1);
expect(wrapper.find('.table-caption').length).toBe(1);
});
});
Expand Down