Skip to content

Commit faead1d

Browse files
committed
patch tests for react-bootstrap-table-next
1 parent 4ec06c9 commit faead1d

File tree

17 files changed

+1042
-946
lines changed

17 files changed

+1042
-946
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"pretest": "yarn lint --cache",
1212
"test": "jest",
1313
"test:coverage": "jest --coverage",
14-
"test:watch": "jest --watch",
14+
"test:watch": "jest --coverage --watch",
1515
"storybook": "cd ./packages/react-bootstrap-table2-example && yarn storybook",
1616
"gh-pages:clean": "cd ./packages/react-bootstrap-table2-example && yarn gh-pages:clean",
1717
"gh-pages:build": "cd ./packages/react-bootstrap-table2-example && yarn gh-pages:build",
@@ -86,7 +86,7 @@
8686
},
8787
"jest": {
8888
"collectCoverageFrom": [
89-
"packages/*/src/*.js",
89+
"packages/*/src/**/*.js",
9090
"packages/*/index.js"
9191
],
9292
"roots": [

packages/react-bootstrap-table2/test/bootstrap-table.test.js

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React from 'react';
22
import { shallow } from 'enzyme';
33

44
import Caption from '../src/caption';
5-
import Store from '../src/store';
65
import Header from '../src/header';
76
import Body from '../src/body';
87
import BootstrapTable from '../src/bootstrap-table';
@@ -25,13 +24,10 @@ describe('BootstrapTable', () => {
2524
name: 'B'
2625
}];
2726

28-
const store = new Store('id');
29-
store.data = data;
30-
3127
describe('simplest table', () => {
3228
beforeEach(() => {
3329
wrapper = shallow(
34-
<BootstrapTable keyField="id" columns={ columns } data={ data } store={ store } />);
30+
<BootstrapTable keyField="id" columns={ columns } data={ data } />);
3531
});
3632

3733
it('should render successfully', () => {
@@ -41,11 +37,6 @@ describe('BootstrapTable', () => {
4137
expect(wrapper.find(Body).length).toBe(1);
4238
});
4339

44-
it('should have correct default state', () => {
45-
expect(wrapper.state().data).toBeDefined();
46-
expect(wrapper.state().data).toEqual(store.data);
47-
});
48-
4940
it("should only have classes 'table' and 'table-bordered' as default", () => {
5041
expect(wrapper.find('table').prop('className')).toBe('table table-bordered');
5142
});
@@ -64,7 +55,6 @@ describe('BootstrapTable', () => {
6455
keyField="id"
6556
columns={ columns }
6657
data={ data }
67-
store={ store }
6858
classes={ classes }
6959
/>);
7060
});
@@ -83,7 +73,6 @@ describe('BootstrapTable', () => {
8373
keyField="id"
8474
columns={ columns }
8575
data={ data }
86-
store={ store }
8776
wrapperClasses={ classes }
8877
/>);
8978
});
@@ -102,7 +91,6 @@ describe('BootstrapTable', () => {
10291
keyField="id"
10392
columns={ columns }
10493
data={ data }
105-
store={ store }
10694
id={ id }
10795
/>);
10896
});
@@ -115,7 +103,7 @@ describe('BootstrapTable', () => {
115103
describe('when hover props is true', () => {
116104
beforeEach(() => {
117105
wrapper = shallow(
118-
<BootstrapTable keyField="id" columns={ columns } data={ data } store={ store } hover />);
106+
<BootstrapTable keyField="id" columns={ columns } data={ data } hover />);
119107
});
120108

121109
it('should have table-hover class on table', () => {
@@ -126,7 +114,7 @@ describe('BootstrapTable', () => {
126114
describe('when striped props is true', () => {
127115
beforeEach(() => {
128116
wrapper = shallow(
129-
<BootstrapTable keyField="id" columns={ columns } data={ data } store={ store } striped />);
117+
<BootstrapTable keyField="id" columns={ columns } data={ data } striped />);
130118
});
131119

132120
it('should have table-striped class on table', () => {
@@ -137,7 +125,7 @@ describe('BootstrapTable', () => {
137125
describe('when condensed props is true', () => {
138126
beforeEach(() => {
139127
wrapper = shallow(
140-
<BootstrapTable keyField="id" columns={ columns } data={ data } store={ store } condensed />);
128+
<BootstrapTable keyField="id" columns={ columns } data={ data } condensed />);
141129
});
142130

143131
it('should have table-condensed class on table', () => {
@@ -148,7 +136,7 @@ describe('BootstrapTable', () => {
148136
describe('when bordered props is false', () => {
149137
beforeEach(() => {
150138
wrapper = shallow(
151-
<BootstrapTable keyField="id" columns={ columns } data={ data } store={ store } bordered={ false } />);
139+
<BootstrapTable keyField="id" columns={ columns } data={ data } bordered={ false } />);
152140
});
153141

154142
it('should not have table-condensed class on table', () => {
@@ -160,7 +148,6 @@ describe('BootstrapTable', () => {
160148
beforeEach(() => {
161149
wrapper = shallow(
162150
<BootstrapTable
163-
store={ store }
164151
caption={ <span className="table-caption">test</span> }
165152
keyField="id"
166153
columns={ columns }

packages/react-bootstrap-table2/test/container.test.js

Lines changed: 0 additions & 209 deletions
This file was deleted.

0 commit comments

Comments
 (0)